
Headless CMS
What Is Headless WordPress and Should You Use It?
Learn how Headless WordPress works, compare REST and WPGraphQL, understand performance, workflows, costs and when a unified platform makes sense for your team.
Planning a headless WordPress build? Learn how to choose the right API, rendering strategy, caching, previews and hosting from the start.
Running WordPress behind a Next.js frontend is an excellent approach for teams that want to keep WordPress' editorial experience while building modern web applications with React. However, the challenge is making the right architectural decisions around APIs, caching, previews, rendering, deployment and hosting before the first line of application code is written.
This guide focuses on those decisions. You'll learn how experienced teams build production-ready Next.js WordPress architectures and how to avoid the implementation choices that become expensive to undo later.
Headless WordPress separates content management from frontend rendering. WordPress acts primarily as the CMS where editors manage pages, media and publishing workflows, while Next.js delivers the visitor-facing frontend. This separation:
A headless WordPress architecture shouldn’t be the go-to choice for every project. A traditional WordPress website is usually the better choice if you:
However, if you need multiple frontend experiences consuming the same content or rendering strategies beyond what a PHP theme can provide, a headless WordPress setup with Next.js becomes worthwhile.
Once you've decided to decouple WordPress, the next architectural decision is the API your frontend will use to retrieve content:
Neither option is universally better. REST favors simplicity and broad compatibility. WPGraphQL favors flexibility, predictable data fetching and a developer experience that's often a better fit for larger React applications. The right choice depends less on traffic or website size than on the complexity of your content model and how your frontend consumes it.
When API responses are cacheable at the edge, the difference between one larger REST response and one smaller GraphQL response becomes less significant because repeat requests are served from the CDN instead of WordPress. At that point, cache hit rates and invalidation strategy have a bigger impact on performance than the API protocol itself.
That doesn't mean the APIs become interchangeable. GraphQL still reduces over-fetching and is generally easier to work with when components need highly structured data from multiple content types. REST remains an excellent choice when your frontend consumes predictable resources and can benefit from WordPress' built-in endpoints and broad plugin compatibility.
For most production headless WordPress projects, the question is which API produces data that's easiest to cache, invalidate and maintain as the application grows. Once a CDN sits between Next.js and WordPress, operational simplicity often becomes a more important optimization than raw response size.
Fetching content from WordPress is straightforward. The bigger architectural decision is when that content should be rendered and how long it should be cached.
Next.js gives you three rendering strategies:
Caching works alongside these rendering strategies through Next.js' built-in Data Cache. Individual fetch() requests can be cached indefinitely, refreshed after a defined interval or retrieved on every request, allowing different parts of the same application to follow different cache policies.
The result is that rendering and caching become content decisions rather than site-wide settings. A homepage, product catalog, documentation page and search results page rarely have the same freshness requirements, so they shouldn't all follow the same strategy.
By matching rendering and cache behavior to publishing frequency, you reduce load on WordPress while ensuring editors see changes reflected when they expect them.
On-demand revalidation is the mechanism that keeps that cache aligned with the editorial workflow. Without it, ISR depends on a time interval. A page might regenerate every 60 seconds, 10 minutes or an hour, which is fine for low-stakes content but awkward when an editor expects a newly published page to appear immediately.
On-demand revalidation replaces that waiting period with an event-based model. When a post, page or custom post type changes in WordPress:
For most production headless WordPress deployments, on-demand revalidation has largely replaced full-site rebuilds. It scales better, reduces unnecessary build times and ensures that content updates invalidate only the pages that actually changed instead of regenerating the entire frontend.
Preview is one of the first workflows that breaks when you decouple WordPress. In a traditional WordPress site, unpublished content is rendered directly by the theme. In a headless architecture, the frontend is a separate application, so it has no way of knowing that a draft exists unless you explicitly build that connection.
To set up post previews for draft articles in a headless WordPress Next.js site, you connect WordPress' Preview action to a secure preview route in your Next.js application. That route validates the request, enables Next.js Draft Mode and fetches the unpublished version of the post instead of the published one. Authenticated editors can then review draft content using the real frontend before publishing, while everyone else continues seeing the cached production site.
The result is a workflow that feels native to content teams while preserving the performance and caching benefits of a decoupled architecture.
Not to mention, you don’t have to start from scratch. Starter kits (covered below) can significantly reduce setup time while preserving the flexibility of a custom Next.js frontend. For teams that want complete control over the architecture, however, implementing the preview workflow directly with Next.js remains a perfectly valid option.
Once WordPress stops rendering the frontend, Gutenberg blocks become structured data instead of HTML templates. Your Next.js application is now responsible for deciding how each block should appear on the page.
The workflow looks like this:
So, if you’re migrating from a traditional WordPress site to Next.js, anything that depended on the WordPress theme layer must either be rebuilt in React or replaced with an API-driven alternative. This includes navigation menus, search, forms, breadcrumbs and SEO output.
However, plugins that manage content, custom fields, SEO metadata, users, e-commerce or editorial workflows generally continue working because they extend WordPress itself.
You don't have to start a headless WordPress project from an empty repository. Several mature starter kits handle the initial project structure, data fetching, routing and WordPress integration, allowing teams to focus on building features instead of wiring the stack together.
The right starter depends on how opinionated you want the foundation to be:
Regardless of which starter you choose, treat it as a long-term architectural decision rather than a quick bootstrap tool.
Most headless WordPress projects start with split hosting. WordPress runs on a managed WordPress host, while the Next.js frontend runs somewhere else. That setup works and for prototypes, it may be enough. But in production, it creates operational drag: two dashboards, two deployment models, two support paths and separate environment rules.
The better model is running both WordPress and Next.js under one operational roof, which is what Pantheon provides.
Pantheon is a WebOps platform for WordPress, Drupal and Next.js that gives teams one place to build, test, launch and manage modern web experiences. It also provides:
SPS Commerce shows why this matters in the real world. The company had a Next.js-powered SupplierWiki site on Netlify and its WordPress marketing site on Pantheon. The stack worked, but it created platform sprawl across a site with roughly 1,600 pages in five languages. By moving SupplierWiki to Pantheon, SPS Commerce consolidated WordPress and Next.js under one platform and gave writers and engineers the same structured workflow the company already trusted for WordPress.
Building a headless WordPress site isn't the difficult part. Building one that's fast, scalable, easy to publish and straightforward to operate over the next five years is. The architectural decisions you make today determine how much complexity your team inherits tomorrow.
That's why the platform matters as much as the framework. With Pantheon, you can build, deploy and scale WordPress and Next.js together using the same enterprise-grade WebOps workflow trusted by some of the world's largest organizations.
Launch your headless WordPress + Next.js website on Pantheon today!

Headless CMS
Learn how Headless WordPress works, compare REST and WPGraphQL, understand performance, workflows, costs and when a unified platform makes sense for your team.

Headless CMS
Decoupled CMS explained: how it works, how it compares to headless and traditional, trade-offs and when it's the right call for your team.

Headless CMS
Headless WordPress promises speed and flexibility. Learn what you gain, what you lose and how to decide if it's the right architecture for your project.