The guide

The REST API: your content turned into data

From /wp-json/wp/v2/posts to clean JSON any front end knows how to read.

Here’s the part that surprises a lot of people: for years now, every WordPress ships with a complete REST API at /wp-json/. Nothing to install, nothing to configure. Your content, already available as JSON and ready for any front end to read.

Try it right now

Open a terminal and ask your WordPress for its posts:

curl http://your-site.local/wp-json/wp/v2/posts

It hands you back a JSON array with every post: title, content, date, links… And there are more routes out of the box, without lifting a finger:

GET /wp-json/wp/v2/posts/42     # a specific post
GET /wp-json/wp/v2/pages        # pages
GET /wp-json/wp/v2/media        # media library images

Ask only for what you’re going to use

The API understands parameters so it doesn’t bring you more than you need. This is key to keeping the front end fast:

GET /wp-json/wp/v2/posts?per_page=6&_fields=id,title,excerpt,slug

With _fields you ask for only the columns you’re going to render and the response weighs a fraction. per_page, categories, orderby… there’s a parameter for almost everything.

When the stock API isn’t enough

For a home page you sometimes want one endpoint that returns it all together and already massaged, instead of making five calls. That gets registered in the mu-plugin with register_rest_route(), and the front end makes a single request. Fewer trips, a simpler front end. This site uses exactly /wp-json/espectacular/v1/landing to serve the home page in one go.

The REST API turns your WordPress into a data source. The front end decides what to do with it.

Let your agent explore it

Copy this across so it maps out your site’s API and proposes the home-page endpoint:

Explore my WordPress REST API (/wp-json) following the wp-wow
skill: show me what endpoints exist, how to filter with _fields
to lighten the responses, and propose a bespoke endpoint for the home page.

Now we’ve got the data coming out clean. Time to give it a face: the front end.

What now?

Build it yourself
or have me build it?

If you’d rather build it yourself, the step-by-step guide is here. And if you’d prefer I build it, tell me about your project and let’s talk.