`/wp-json/` answers before you write a line of code. That’s the easy part. The hard part starts with your own route: who may call it, what it accepts, how much it returns, and what happens when a hundred requests hit it at once.
This course takes you from the four verbs of CRUD on wp/v2 to an API that blocks, admin screens and a headless front end can rely on. Every module is built on real code from our published plugins and on real cases from wordpress.org plugin review, not on made-up /projects endpoints.
Course path
What you’ll be able to do after each module
- REST API & CRUD: read any WordPress API. Routes, verbs, status codes, pagination headers and the
/wp-json/index. - Custom endpoints: your plugin gets its own home.
register_rest_route, namespace and version, one route with two doors. - Extending wp/v2: your data on core’s routes.
show_in_rest, registered meta, and when a new route is the better answer. - Permissions: authenticated is not authorized. 401 vs 403, capabilities per route and per object, and how much data comes back.
- Schema & validation: bad input stops at the door.
args,type,enum, and thesanitize_callbacktrap. - Your own API inside WordPress: no more “logged in, but a guest”. Nonces,
apiFetch,rest_do_request(). - Performance: fast under load. Page-size caps,
no_found_rows, batch meta, caching other people’s APIs. - Testing & debugging: every error tells you where it stopped. Route → args → permission → callback, with curl and WP-CLI.
- REST for headless: one GET, a whole site. A React front end that shows what you publish, with no rebuild step.
How a lesson works
| Part | What you get |
|---|---|
| A real case | a story from our plugins or from wordpress.org review |
| Short theory | only what you need for the code |
| Code and requests | real routes, real WordPress core errors |
| Common mistakes | symptom → cause → fix |
| Practice | requests to run against your local site |
| Interview questions | ready answers to the questions interviewers ask |
Who it’s for: WordPress developers who use wp/v2 but haven’t shipped their own routes yet, or who have and want them to pass review.
Result: you design, secure, validate, test and ship REST endpoints for blocks, admin screens and headless front ends.
Outside this course
- GraphQL → GraphQL for WordPress Developers
- REST API hooks → 4wp.dev/hooks/category/rest-api/
- Git and CI → Git Basics Course