Headless WordPress with Next.js: when it makes sense

An honest look at headless WordPress with Next.js, covering how it works, real costs, when it pays off and when a normal WordPress site is the better choice.

Headless WordPress with Next.js means using WordPress only as the place where content is written and stored, and building the public website as a separate Next.js app that pulls content from WordPress through an API. Editors keep the familiar dashboard. Visitors get a fast, modern front end that never runs WordPress code directly.

It makes sense when you need speed, security or design freedom that normal WordPress struggles to deliver, and you have the budget to maintain two systems. It doesn't make sense for most small business brochure sites, where a well-built standard WordPress site is cheaper, simpler and good enough.

I build both, so here's an honest breakdown of when headless pays off and when it just adds cost.

How headless WordPress works

In a normal WordPress site, one system does everything: stores content, applies the theme and outputs every page. In a headless setup the jobs split:

  • WordPress (the "back end") holds posts, pages, custom fields and media. Editors log in as usual. The public theme isn't used.
  • The API exposes content as data. Either the built-in REST API (at /wp-json/) or GraphQL via the WPGraphQL plugin.
  • Next.js (the "front end") fetches content at build time or on request, renders pages, and is deployed separately, often to a platform like Vercel or to static hosting.

A simple fetch from a Next.js Server Component using the REST API might look like this:

// app/blog/[slug]/page.tsx
import { notFound } from 'next/navigation';

type Props = { params: Promise<{ slug: string }> };

export default async function PostPage({ params }: Props) {
  const { slug } = await params;
  const res = await fetch(
    `https://cms.example.com/wp-json/wp/v2/posts?slug=${slug}&_fields=title,content`,
    { next: { revalidate: 300 } }
  );
  const [post] = await res.json();
  if (!post) notFound();

  return (
    <article>
      <h1 dangerouslySetInnerHTML={{ __html: post.title.rendered }} />
      <div dangerouslySetInnerHTML={{ __html: post.content.rendered }} />
    </article>
  );
}

The revalidate option caches the page and refreshes it in the background at most every five minutes. For instant updates, a webhook from WordPress can trigger revalidation when a post is saved. Since this renders HTML from WordPress, only trusted editors should be able to publish.

When headless makes sense

These are the situations where I recommend it:

  • High-traffic content sites. A news or publishing site that needs fast pages under heavy traffic benefits from static or cached Next.js pages served from a CDN.
  • Custom, app-like front ends. Interactive tools, calculators, dashboards or complex filtering that are awkward in a WordPress theme.
  • One content source, several outputs. The same content feeds a website, a mobile app and maybe digital signage.
  • Existing WordPress team, modern front end wanted. Editors are trained on WordPress and the content is already there, but the business wants a Next.js front end.
  • Security-sensitive brands. The WordPress install can sit on a private address or behind access controls, so the public never touches it.
  • Performance targets that matter commercially. When page speed directly affects revenue and you're willing to invest to get it.

When it doesn't make sense

And these are the cases where I talk people out of it:

  • Small brochure sites. Five to twenty pages, a contact form and a blog. A lean WordPress site or a static Next.js site on its own is simpler.
  • Heavy reliance on page builders. Elementor and similar builders design pages inside the WordPress theme. In headless, that layout is mostly lost. Editors can't drag and drop the public design anymore.
  • Plugin-dependent features. Forms, SEO plugins, membership, booking and WooCommerce all assume WordPress renders the front end. Many need rebuilding or replacing in Next.js.
  • Small budgets and no developer on call. Two systems mean two sets of updates, two hosting bills and someone who understands both.
  • Editors who need live preview everywhere. Preview is possible in headless but takes extra setup.

The real costs and trade-offs

AspectStandard WordPressHeadless WordPress + Next.js
Build costLowerHigher (two systems, integration)
HostingOne hostWordPress host plus front-end host
Speed potentialGood with careExcellent by default
Security surfacePublic WordPressWordPress can be hidden
PluginsWork out of the boxFront-end features need rebuilding
Editor experienceFull visual editingContent editing, limited visual layout
PreviewBuilt inNeeds setup
MaintenanceOne codebaseTwo codebases

The SEO side needs attention too. In headless, Yoast or Rank Math still store titles and descriptions, but Next.js has to fetch and output them. The same goes for sitemaps, redirects and schema. My Next.js SEO guide covers the front-end side.

Two practical details catch teams out after launch. The first is preview. Editors are used to clicking "Preview" and seeing the page exactly as it will look. In headless, that button has to open the Next.js site in draft mode and fetch the unpublished version through an authenticated request. It's very doable, but it has to be built and tested, and it's often missing from cheap headless builds.

The second is publishing speed. If pages are statically generated, a new post doesn't appear until the site rebuilds or the cache revalidates. I usually connect a small webhook from WordPress that tells Next.js to revalidate the affected pages on save, so editors see changes within seconds instead of wondering why nothing happened.

REST API or GraphQL

Two ways to get data out of WordPress:

  • REST API. Built into WordPress, no plugin needed. Simple to start with. You may need several requests or custom endpoints for complex pages. Documented in the WordPress REST API handbook.
  • WPGraphQL. A plugin that adds a GraphQL endpoint. You ask for exactly the fields you need in one request, and it has extensions for ACF and SEO plugins. My usual choice for larger headless builds.

For a small headless project, REST is often enough. For anything with lots of custom fields and relationships, GraphQL usually saves time.

Alternatives worth considering

Before committing to headless, compare it with:

  1. A faster standard WordPress site. Good hosting, a lightweight theme, caching and fewer plugins can get WordPress very fast. For many sites this closes most of the speed gap at a fraction of the cost.
  2. Next.js with Markdown or a hosted CMS. If you're starting fresh and don't need WordPress, a purpose-built headless CMS or simple Markdown files may be easier than running WordPress just for content.
  3. A full move to Next.js. For sites that rarely change, moving content into the Next.js project removes WordPress entirely.

If you're still choosing between the platforms in general, my honest Next.js vs WordPress comparison goes through that decision.

Questions to ask before you decide

  • Who edits the site, and how often?
  • Which WordPress plugins does the site depend on, and what replaces each one?
  • Do editors need to build page layouts, or just write content?
  • Is there a measurable reason for the speed or security improvement?
  • Who will maintain both systems after launch?
  • What's the budget for two hosting setups?

If the answers point to "small team, mostly simple pages, plugin-heavy", stay with normal WordPress. If they point to "large content volume, custom front end, technical team available", headless is worth it.

The short version

Headless WordPress with Next.js gives you WordPress's editing experience with a fast, secure, flexible front end. It pays off for content-heavy, high-traffic or highly custom sites with a team to maintain it. For most small business sites, it adds cost and complexity you don't need.

If you're weighing up headless for a real project, I'm happy to look at your current site and give you a straight answer. See my Next.js development service or contact me.

Available for new projects

Need a hand with this?

Tell me what you need: a new site, a fix, a SaaS or an app. You'll get a clear plan and price within a day.

Start a project WhatsApp me