
Table of Contents
Run headless WordPress only when you need a separate frontend, multi-channel delivery, or a JavaScript app at scale. Verification is done correctly when the REST or GraphQL API returns content with no theme layer, the frontend builds from that API alone, and preview plus SEO still work in production. If your site is a standard brochure or blog, keep classic WordPress and skip the extra infrastructure.
Headless WordPress Architecture Step by Step Process
- Install WordPress 6.8+ (2026 stable) on a managed host or VPS with PHP 8.3+ and MariaDB 10.11+.
- Expose content through the core REST API at
/wp-json/wp/v2/or add WPGraphQL 1.28+ for typed queries. - Build the frontend with Next.js 15 or Nuxt 4 and fetch data only from the API, never from PHP templates.
- Configure
wp-config.phpwithdefine('HEADLESS_MODE', true);to disable theme rendering for public traffic. - Set up preview: register a custom preview route in the frontend and use
post_preview_urlfilter in WordPress. - Deploy frontend to Vercel or Netlify and keep WordPress on your server with a CDN in front.
Ops Cost After Decoupling
Decoupling doubles your deployment surface. You now run WordPress as a content API plus a separate Node or PHP frontend build pipeline. In 2026 a typical stack uses WordPress on Kinsta or Cloudways, a Next.js frontend on Vercel, and Cloudflare in front. Each layer adds monitoring, CI minutes, and on-call load.
To see the cost, check your pipeline. Run npm run build locally and time it. Then check Vercel usage with vercel logs <deployment-url>. If the frontend rebuilds on every content save, costs scale with editor activity, not traffic.
A concrete guard is to move to incremental static regeneration. In Next.js use export const revalidate = 60; in your route so pages rebuild at most once a minute instead of on every request.
// app/posts/[slug]/page.tsx (Next.js 15)
export const revalidate = 60;
export default async function Post({ params }) {
const res = await fetch(
`https://cms.example.com/wp-json/wp/v2/posts?slug=${params.slug}&_embed`
);
const [post] = await res.json();
return <article>{post.title.rendered}</article>;
}
Common pitfall: leaving _embed on every query pulls the full author and media objects and slows the API. Roll back by setting revalidate to 0 and serving from WordPress again if latency or bills spike. For teams that do not want two pipelines, our Custom WordPress Development team keeps everything inside one managed stack.
Preview and Editor Experience
Get a Quote
Email + requirement + budget range — we reply with a quote within 24 hours.
Preview breaks first in headless setups because the admin no longer renders the theme. Fix it by pointing WordPress preview links at the frontend. Use the preview_post_link filter in your theme or a small mu-plugin.
Create wp-content/mu-plugins/headless-preview.php and add the filter below. Then verify by clicking Preview in the block editor and confirming the frontend draft route loads with a ?secret= token.
add_filter('preview_post_link', function($link, $post) {
return 'https://frontend.example.com/api/preview?'
. http_build_query([
'slug' => $post->post_name,
'id' => $post->ID,
'token' => wp_create_nonce('headless_preview'),
]);
}, 10, 2);
On the frontend, validate the nonce by calling back to WordPress /wp-json/ with the token. If preview fails after a WordPress core update, check that the REST route still allows the nonce scope and roll back the mu-plugin by renaming the file.
Editors also lose the theme customizer. Replace it with ACF or block-based fields and document the fields in the admin. If your team relies on visual page building, read our WordPress admin dashboard tutorial to plan the replacement UI before you decouple.
SEO and Rendering
Headless removes server-rendered HTML unless you rebuild it. Use SSR or SSG so crawlers get full HTML. Verify with curl -s https://frontend.example.com/post | grep '<title>'; if nothing returns, the page is client-rendered and SEO will suffer.
Add canonical URLs and meta through the frontend head manager, and keep Yoast or Rank Math data exposed via REST with the yoast_head_json field. Check the API includes it by requesting /wp-json/wp/v2/posts?_fields=yoast_head_json.
Pitfall: duplicate content when both WordPress and the frontend are indexed. Fix by sending X-Robots-Tag: noindex from wp-config.php on the CMS domain and keeping only the frontend indexed. Roll back by removing the header if you merge stacks again. See the official WordPress REST API handbook for field control.
Comparison: Headless vs Classic WordPress

| Dimension | Headless WordPress | Classic WordPress | Best fit |
|---|---|---|---|
| Ops cost | Two pipelines, higher | One stack, lower | Headless only with dedicated DevOps |
| Preview | Custom route needed | Native and instant | Classic for editor-heavy teams |
| SEO | SSR/SSG required | Server-rendered by default | Headless with Next.js SSG |
| Speed at scale | Edge cached, very fast | Good with CDN | Headless for global apps |
| Budget | Higher build and run | Lower upfront | Classic for small sites |
Choose headless if you ship to web plus mobile plus kiosk from one CMS. Choose classic for a single site. If you run a small business site, our guide on WordPress for small business websites shows why classic wins there.
When It Is the Wrong Choice
Headless is wrong when you have one website, a small team, and no frontend engineers. The cost of maintaining Node builds, preview tokens, and SSR debugging outweighs the speed gain. It is also wrong when editors depend on the customizer, widgets, or live theme preview, because those do not exist after decoupling.
Avoid it for brochure sites, local business pages, and simple blogs. Roll back by pointing DNS to the original WordPress install, removing HEADLESS_MODE from wp-config.php, and clearing CDN cache with your provider CLI.
Action Checklist
- Audit whether you need multi-channel delivery before decoupling.
- Verify REST or GraphQL output with curl before building the frontend.
- Set revalidate intervals to control build costs.
- Test preview with a nonce and confirm SEO meta in raw HTML.
- Keep a DNS rollback plan to classic WordPress.
Need a headless or classic build done right? See our WordPress development services and get a technical audit today.
