WordPress REST API Course

`/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…

0 lessons

`/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

Diagram

Stage 3 · Ship it

Stage 2 · Build your own

Stage 1 · Read the API

Today: GET/wp-json/wp/v2/posts1. REST API &CRUDverbs · routes · statuscodes✓ You read any WordPressAPI2. Custom endpointsregister_rest_route ·namespace3. Extending wp/v2show_in_rest · meta4. Permissions401 vs 403 · object caps5. Schema &validationargs · validate_callback✓ Routes that pass wp.orgreview6. Your own APIinside WPnonce · apiFetch7. Performancelimits · batch meta · cache8. Testing &debuggingcurl · ApplicationPasswords9. REST for headlessone GET · revalidateResult: a secure, fast,tested APIand answers to interviewquestions

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 the sanitize_callback trap.
  • 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

PartWhat you get
A real casea story from our plugins or from wordpress.org review
Short theoryonly what you need for the code
Code and requestsreal routes, real WordPress core errors
Common mistakessymptom → cause → fix
Practicerequests to run against your local site
Interview questionsready 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