Your editors love the WordPress dashboard. Your developers want React, instant page loads and a modern build pipeline. Headless WordPress lets you have both: keep WordPress as the content engine and admin, and put a fast Next.js frontend in front of it. Here's exactly how the setup works, when it's worth it, and the trade-offs nobody mentions until you're halfway in.
Key Takeaways
- Headless means WordPress stops rendering pages — it just stores content and serves it over an API.
- Editors keep the familiar WordPress admin; the public site is built in Next.js.
- Connect the two with WPGraphQL (recommended) or the built-in REST API.
- You gain speed, security and flexibility — at the cost of a more complex build and some lost “preview” conveniences.
- Great for content-heavy, performance-critical sites; overkill for a simple brochure blog.
What “headless WordPress” actually means
In a normal WordPress site, one system does everything: it stores your content andrenders the HTML using a PHP theme. “Headless” splits that in two. WordPress keeps doing what it's great at — storing content, media and the admin experience — but it stops generating the public pages. Instead, it exposes your content through an API, and a separate frontend (here, Next.js) fetches that content and renders the site.
The “head” is the presentation layer. Remove WordPress's built-in head and bolt on your own, and you have headless WordPress — also called decoupled WordPress.
Think of WordPress as the kitchen (where content is prepared and managed) and Next.js as the dining room(what visitors actually see). The API is the window between them. Your editors never leave the kitchen they know; your visitors get a beautifully designed dining room with none of the kitchen's clutter.
Why teams go headless
The headline benefit is performance. With Next.js you can statically generate or server-render pages and serve them from a CDN, instead of WordPress building each page in PHP on every visit. That usually means faster load times and better Core Web Vitals — which help both users and SEO.
The second benefit is security and separation. Because the public site is just static/React output, the WordPress install (the most-attacked CMS on the web) can sit behind a private URL, not directly exposed to every bot on the internet. And your front-end team works in a modern React codebase instead of wrangling PHP templates.
The honest trade-offs
Headless isn't free. You're running and deploying two systems instead of one, and some conveniences WordPress users take for granted need extra work to rebuild.
You gain
- Much faster front-end performance
- Modern React / Next.js developer experience
- Design freedom — no theme lock-in
- Better security separation
- One content source for web, app, etc.
You give up (or rebuild)
- Live preview & the WYSIWYG “what you see” match
- Many WordPress plugins that output HTML
- Simplicity — now two systems to host & deploy
- Some page-builder workflows
- Higher upfront build cost
How to connect WordPress to Next.js
There are two main ways to pull content out of WordPress. Both are solid; the choice mostly comes down to how much data you fetch and how much control you want.
| Option | What it is | Best for |
|---|---|---|
| REST API | Built into WordPress — no plugin needed. Returns JSON from endpoints like /wp-json/wp/v2/posts. | Simple needs, quick start, no extra setup |
| WPGraphQL | A free plugin that adds a GraphQL API. Ask for exactly the fields you need in one query. | Most projects — efficient, typed, fewer round-trips |
For most builds we'd reach for WPGraphQL: you request precisely the fields a page needs in a single query, which keeps payloads small and code clean. The REST API is perfectly fine for simpler sites and needs zero plugins.
Fetching posts with the REST API
A minimal example in a Next.js server component:
// app/blog/page.tsx — Next.js (App Router)
async function getPosts() {
const res = await fetch(
"https://cms.yoursite.com/wp-json/wp/v2/posts?_embed",
{ next: { revalidate: 60 } } // ISR: refresh every 60s
);
return res.json();
}
export default async function Blog() {
const posts = await getPosts();
return (
<ul>
{posts.map((p: any) => (
<li key={p.id} dangerouslySetInnerHTML={{ __html: p.title.rendered }} />
))}
</ul>
);
}Fetching with WPGraphQL
The same idea, but you ask for only the fields you want:
const query = `
query LatestPosts {
posts(first: 10) {
nodes { id title slug excerpt date }
}
}
`;
async function getPosts() {
const res = await fetch("https://cms.yoursite.com/graphql", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query }),
next: { revalidate: 60 },
});
const { data } = await res.json();
return data.posts.nodes;
}Notice the revalidateoption in both — that's Next.js Incremental Static Regeneration. Pages are served static-fast from cache, then quietly refreshed in the background so editors' changes appear without a full rebuild.
Keeping content fresh: ISR & webhooks
The classic worry with a static frontend is: “If pages are pre-built, how do edits show up?” Two answers, often used together:
- ISR (time-based): set
revalidateso pages refresh every N seconds. Simple and reliable. - On-demand revalidation (webhooks): WordPress pings your Next.js site the moment a post is published or updated, instantly rebuilding just that page. Best of both worlds — static speed, near-instant updates.
Headless WooCommerce: same idea, for stores
Everything above applies to e-commerce too. With headless WooCommerce, your team manages the entire shop — products, prices, variations, stock, orders and coupons — from the familiar WooCommerce screens inside WordPress admin. WooCommerce stays the source of truth for your catalogue and checkout logic. The storefront your customers browse, however, is built in Next.js / React, so product pages load fast and feel app-like.
WooCommerce exposes its data through the WooCommerce REST API (and you can layer WPGraphQL for WooCommerce on top). Your Next.js frontend fetches products and renders custom product listings, search and category pages; the cart and checkout can either use the Woo APIs or hand off to WooCommerce for the secure payment step.
// Fetch products from WooCommerce REST API in Next.js
async function getProducts() {
const res = await fetch(
"https://shop.yoursite.com/wp-json/wc/v3/products?per_page=12",
{
headers: {
// server-side only — never expose keys in the browser
Authorization: "Basic " + btoa(`${process.env.WC_KEY}:${process.env.WC_SECRET}`),
},
next: { revalidate: 120 },
}
);
return res.json();
}Product pages are where speed turns directly into revenue — faster pages mean better Core Web Vitals, higher conversions and lower bounce. A headless Woo setup keeps the back-office your team already knows while giving shoppers a fast, fully-custom storefront. The trade-off: cart, checkout and many Woo extensions need careful rebuilding, so it suits stores where performance and custom UX genuinely matter — not a tiny shop with a handful of products.
When headless WordPress is the right call
Like most architecture decisions, this isn't universal. Use this quick gut-check:
Go headless if…
- Performance & Core Web Vitals really matter
- You want a custom, design-led frontend
- You have (or want) a React team
- Content feeds web + app + other channels
Stay classic WordPress if…
- It's a simple brochure or blog site
- Editors rely on live preview & page builders
- Budget & timeline are tight
- You don't have front-end developers
Our take
Headless WordPress is a fantastic fit when you want the familiar WordPress adminfor your editors and a fast, custom Next.js experiencefor your visitors — especially for content-heavy, performance-sensitive sites. If you're running a small brochure site with one editor and a tight budget, classic WordPress is still the pragmatic choice. Match the architecture to the project, not the hype.
Frequently asked questions
Do editors still use the normal WordPress dashboard?
Yes — that's the whole appeal. Authors write, upload media and manage content in the same WordPress admin they already know. Only the public-facing rendering moves to Next.js.
REST API or WPGraphQL — which should I use?
WPGraphQL for most projects: you fetch exactly the fields you need in one query, which is efficient and clean. The built-in REST API is great for simpler sites and requires no plugins.
Will my WordPress plugins still work?
Plugins that manage content or data (custom fields, SEO metadata, forms-as-data) generally work well. Plugins that output HTML or rely on the WordPress theme often won't — you rebuild that functionality in your Next.js frontend instead. Audit your must-have plugins before committing.
Can I use headless with WooCommerce?
Yes. With headless WooCommerce, products, stock, orders and pricing are managed in the WordPress / WooCommerce admin, while the storefront is built in Next.js. You fetch catalogue data via the WooCommerce REST API (or WPGraphQL for WooCommerce). It's a strong fit for stores where page speed and a custom shopping experience matter; just plan carefully for cart and checkout.
Is headless WordPress better for SEO?
It can be, mainly through speed and Core Web Vitals. But you must reproduce the SEO basics in Next.js — titles, meta descriptions, canonical tags, structured data and sitemaps — since you're no longer relying on a WordPress SEO plugin to render them. Done right, headless is excellent for SEO; done carelessly, you can lose ground.
The bottom line
Headless WordPress gives you the best of both worlds: the admin experience editors trust, and a modern, fast, fully-custom frontend for everyone else. It adds complexity, so it shines on content-heavy and performance-critical projects rather than simple sites. Pick WPGraphQL, lean on ISR plus webhooks for fresh content, and don't forget to rebuild your SEO essentials in Next.js.
Thinking about going headless with your WordPress site? Tell us about your setup— we'll give you a straight, build-or-don't recommendation based on your content, team and goals.