Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

Does WordPress Have a REST API? What It Does and Who Needs It

Yes. The WordPress REST API lets applications send and receive JSON through endpoints for posts, pages, taxonomies and other built-in data types, and it's the foundation of the block editor. Public content is generally readable without logging in, while private content needs authentication, such as a cookie with a nonce or Application Passwords.

Yes, and you're already using it

If you've written a post in the block editor, you've used the REST API without knowing. The developer handbook calls it the foundation of the WordPress Block Editor. It's an interface that lets applications interact with a site by sending and receiving data as JSON objects, through endpoints that represent posts, pages, taxonomies and other built-in data types. You can query, modify and create content through those endpoints.

Any programming language that can make HTTP requests and read JSON can use it, from PHP, Node.js, Go and Java to Swift and Kotlin.

Do you need it at all?

Probably not for everyday site building. The handbook says plainly that you don't need the REST API to build a theme or plugin. It suits other jobs: client-side JavaScript apps, standalone programs, and external applications that need to read or write content on your site.

  • Publishing posts from another system, such as a content calendar or an automation.
  • Showing your blog posts inside a mobile app or a separate front end.
  • Pulling content into a reporting or search tool.
  • Bulk updates that would take hours by hand in the dashboard.

If you're thinking about automating publishing, this guide on automating WordPress publishing shows what that looks like in practice, and this explainer on what a REST API is covers the basics if the term is new.

What's public and what isn't

The REST API follows the same restrictions as the site itself. Public content is generally readable by anyone. Private content, password-protected content, internal users, custom post types and metadata need authentication, or have to be exposed deliberately. So the API doesn't make your drafts or private pages public; it shows what the site would already show a logged-out visitor.

Authenticating requests

Inside WordPress, cookie authentication is the standard method, used by the block editor and by themes and plugins running on the site. Every request must carry a nonce, created for the action wp_rest, in the _wpnonce parameter or the X-WP-Nonce header. Without it, the request is treated as unauthenticated, even if you're logged in.

For external applications, the handbook lists Basic Authentication with Application Passwords, and authentication plugins, as the routes to use. Another system's sign-in routes are laid out in whether Jira has an API.

Getting more than 100 items

WordPress Developer Resources flag the limit that catches most first-time scripts. Collections return a limited number of items by default, and the per_page parameter accepts 1 to 100 and is capped at 100 records. So a site with 450 posts can't be pulled in one request. Every paginated response includes two headers: X-WP-Total for the total number of records and X-WP-TotalPages for the number of pages. Read X-WP-TotalPages from the first response, then loop through the pages.

The handbook also covers global parameters, linking and embedding, discovery, and an FAQ, and lists client libraries and a Backbone.js client for anyone who'd rather not build requests by hand.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

Other content platforms with APIs

Ghost's Content API is managed with an API key and designed to be fully cachable, so you can fetch data as often as you like. Strapi's REST API generates endpoints for each content type automatically, to fetch, create, update and delete documents, with filtering, sorting and relation population built in. If you're tidying your plugin stack at the same time, here's my list of WordPress plugins worth having.

My advice before you connect anything

Decide first whether you need the API or a plugin will do. If you do need it, use Application Passwords for outside tools, page through collections 100 at a time using X-WP-TotalPages, and remember that a missing nonce quietly turns a logged-in request into an anonymous one. Test against a staging copy before you write to a live site.

Want your tool on this list? Featured spots and reviews here are paid partnerships. Here's how to partner with me.

Frequently asked questions

Is the WordPress REST API on by default?

The handbook describes it as a built-in interface and the foundation of the block editor.

Can anyone read my content through it?

Public content is generally readable; private and password-protected content and internal users need authentication.

How do I authenticate from an outside app?

The handbook lists Basic Authentication with Application Passwords, or authentication plugins. Cookie plus nonce is for use inside WordPress.

How many items can I get per request?

Up to 100, since per_page is capped at 100.

Which languages can use it?

Any language that can make HTTP requests and read JSON.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.