Cut the head off, and REST keeps WordPress talking to the front end. One route returns a whole site: menus, settings, FAQ, team and portfolio. This module builds that bridge on the 4WP Headless App plugin.
| Course | WordPress REST API Course ยท Module 9 of 9 ยท Stage 3 "Ship it" |
| Learn | An export route, per-resource routes, a GET helper in React, fresh content on publish, what never goes into the client bundle |
| How | Real code from 4WP Headless App, a React front end with one plain fetch, interview questions after every lesson |
One GET, a whole site
flowchart LR
WP[("WordPress<br/>4WP Headless App")] -- "GET /wp-json/4wp/v1/export" --> FE["React front end"]
WP -- "per-resource routes" --> FE
ED["Publish in WordPress"] --> WP
classDef wp fill:#ebf3fb,stroke:#61affe,color:#1e293b
classDef fe fill:#edfcf9,stroke:#50e3c2,color:#1e293b
class WP wp
class FE fe
REST is one door, GraphQL is the other. The headless front end does not care which, as long as the contract holds.
Before โ after
| Before | After Module 9 |
|---|---|
| A theme rebuild for every content change | publish in WordPress, the next request shows it |
| Ten requests for one page | one export route |
| API keys in the client bundle | secrets stay on the server |
| REST vs GraphQL as a religion | pick the door that fits the contract |
You'll be able to answer
- How would you serve a whole headless site from WordPress over REST?
- How does a headless front end get fresh content after publishing?
- What must never end up in a headless client bundle?