ZeroToWP

REST API

Quick Definition

The WordPress REST API lets external applications read and write your site's data using standard HTTP requests and JSON. It's what powers the Block Editor and enables headless WordPress setups.

WordPress.org — the REST API enables applications to interact with WordPress data

What Is the REST API?

The WordPress REST API provides an interface for applications to interact with your WordPress site by sending and receiving data as JSON objects. According to the official REST API handbook, REST stands for REpresentational State Transfer — a set of concepts for modeling and accessing application data.

In plain English: the REST API lets any application — a mobile app, a JavaScript front-end, an external service, or even another website — talk to your WordPress site over HTTP. It can read your posts, create new pages, update categories, manage users, and much more.

The REST API uses JSON (JavaScript Object Notation) — a lightweight, human-readable data format. When you request yoursite.com/wp-json/wp/v2/posts, you get back a JSON array of all your published posts with their titles, content, dates, authors, and metadata.

The REST API in Practice

Every WordPress site has a REST API available at /wp-json/. The default endpoints include:

  • /wp/v2/posts — all posts
  • /wp/v2/pages — all pages
  • /wp/v2/categories — all categories
  • /wp/v2/tags — all tags
  • /wp/v2/users — all users
  • /wp/v2/media — all media files

The most important thing built on the REST API: the Block Editor (Gutenberg). When you edit a post in the block editor, it's a JavaScript application communicating with WordPress through the REST API. Every save, every preview, every autosave — it's all REST API calls behind the scenes.

Other common uses:

  • Headless WordPress — use WordPress as a backend CMS and build the front-end with React, Next.js, or Vue.js, pulling content via the REST API
  • Mobile apps — build iOS/Android apps that display WordPress content
  • Plugins — modern plugins use the REST API instead of the older admin-ajax.php for faster, more secure requests
  • External integrations — connect WordPress to CRMs, email services, or analytics platforms

Authentication for write operations uses application passwords (built into WordPress since 5.6), cookies, or OAuth tokens.

Why It Matters

The REST API is what makes modern WordPress possible. Without it, there's no Block Editor, no headless setups, no mobile apps powered by WordPress. Even if you never call the API directly, you use it every time you edit a post. For developers, it's the key to building custom WordPress-powered applications. See our dashboard guide and plugins roundup for more on WordPress's architecture.

Related Terms

Related Articles