Download CV
Projects

Next.js + Headless WordPress in 2026 – When Does This Architecture Actually Make Sense?

·Łukasz Kopyszko
[WordPress for Business][Next.js][WordPress][Headless][CMS][Architektura]

Headless WordPress + Next.js in 2026 is a legitimate stack, not magic. It is also the most expensive brochure site I still see in briefs. This is not “headless is the future”. It is a decision: classic WP, or WP as a CMS and Next as the front — when that pays, what it costs, and where it falls over.

Broader architecture (commerce, other CMSs): headless technology in 2026.

Two models

Classic WordPress — PHP renders HTML. Theme, plugins, cache (plugin + CDN), wp-admin and the front are one system. Preview, forms, search, WooCommerce work because they share the request.

Headless — WP stays the panel and the API (REST or WPGraphQL). Next.js (App Router) owns HTML: SSG/ISR/SSR, cache tags, revalidate. The public origin is Node/Vercel, not Apache plus a theme. You hide wp-admin behind a VPN — a real security win, not a free lunch.

REST vs GraphQL

REST is in core, no plugin, painful overfetch, pagination, ACF as a giant JSON blob. WPGraphQL gives precise queries and a schema, and it is a dependency you upgrade with core — after WordPress 7.1 you check GraphQL the same way you check the theme.

On small sites REST plus a thin mapper is enough. On many content types, relations, and i18n, GraphQL usually wins. Do not run both “just in case”.

SSR, SSG, ISR, cache

Render choice is a business choice:

  • SSG — pricing, landing, case study. Build on publish.
  • ISR / revalidateTag — blog, listings. Webhook from WP on save. Next 16.3 ISR with Cache Components can show a shell on the first hit — Instant Navigations.
  • SSR — session, geo, preview token. You pay TTFB.

Cache without invalidation is a stale post on a CDN. Invalidation without cache is origin on its knees. Tag by slug and taxonomy, not “revalidate everything every 60s”.

// app/api/revalidate/route.ts
import { revalidateTag } from "next/cache";
import { NextRequest } from "next/server";

export async function POST(req: NextRequest) {
  const secret = req.headers.get("x-webhook-secret");
  if (secret !== process.env.WP_REVALIDATE_SECRET) {
    return new Response("no", { status: 401 });
  }
  const slug = (await req.json()).slug as string;
  revalidateTag("wp:" + slug);
  return Response.json({ revalidated: true });
}

The secret stays server-side. WP hits the webhook on save_post. Unsigned, it is a public cache flush.

SEO and Core Web Vitals

Headless does not hurt SEO if HTML comes from the server. It hurts when content is client-only. You gain control of metadata, hreflang, JSON-LD, less plugin CSS. You pay by reimplementing what Yoast did with clicks — canonical, ACF og:image, a sitemap that joins WP and the front.

CWV: Next + CDN usually beats a theme with 40 plugins. It does not automatically beat a lean WP theme on a host with full-page cache. Measure. On WP vitals: why 80% of WP sites fail CWV.

Deploy: Vercel vs VPS

Vercel is the natural App Router target (per-PR previews, ISR, edge). A VPS (Docker + Nginx) when you have compliance, a fixed bill, or WP already clustered. Then you run two origins: API (WP) and front (Next) — see Next.js on a VPS.

Content preview: WP draft + a tokenised Next route. Without it, editors go back to “publish and pray”.

Forms, search, WooCommerce

Forms — Contact Form 7 dies in headless. A Next endpoint with validation and Turnstile, or WP REST with a nonce you do not expose without a limit.

Search — WP SQL search over API does not age well. Algolia / Meilisearch / OpenSearch, indexed from a webhook. Another system to run.

WooCommerce — this is where headless hurts: cart, tax, payments, stock, mail. The Store API exists; a full custom checkout is a product, not a theme port. Checkout often stays on WP or at the gateway. If the store is the business, classic Woo on solid hosting is often cheaper than two years of cart work.

Security

Public Next does not execute PHP plugins — smaller surface. wp-admin behind VPN/SSO is a real gain (same idea as VPN for remote orgs). Left: API enumeration, application-password brute force, GraphQL introspection leaks, unsigned webhooks. WP hardening still applies: the checklist.

Build and run cost

Classic WP: theme/child, a few paid plugins, hosting, a retainers for updates. Headless: Next front, ACF→types mapping, preview, cache, CI, monitoring, someone who speaks both stacks. Year one is often 2–3×. Run cost: two changelogs (WP + Next), two backups, two on-calls.

Ballpark for the monolith: WordPress maintenance cost in 2026. Headless does not delete that line — it adds a second one.

Scenario | WordPress | Headless WordPress

Scenario Classic WordPress Headless WP + Next.js
Brochure, blog, one language, non-technical editors Yes — default Overkill
Many channels (web + app) from one CMS Poor fit Yes
Design system + motion + App Router Fighting the theme Natural
WooCommerce checkout out of the box Yes Risky / expensive
Core Web Vitals under ads/SEO Possible with discipline Easier if SSR/SSG is done right
Editorial preview Built in You build it
Team: one WP developer Fits Does not
Team: front + back, 12+ month budget Possible, tight stack Fits

When I would pick classic WP vs headless

Classic WP — company site, blog, campaign landing, small catalogue, a team that lives in wp-admin, budget for a site not a platform. Typical company sites in the portfolio are in that bucket.

Headless — the product is already an app (dashboard, AI, its own auth) and marketing still wants WP; or the front must be Next with i18n and ISR while editors will not give up Gutenberg. Then WP is a CMS, not “the website”. That is the split I use when the stack is Next anyway — the direction of something like Księgowy AI (app) with a separate marketing content pipeline.

I do not pick headless because “that is how 2026 is done”. I pick it when two systems cost less than fighting a theme, or when I need more than one front.

FAQ

Is headless more secure?

Less public PHP — yes. Zero risk — no. An open GraphQL endpoint and an unpatched core (see summer 2026) still take the CMS down.

Can I keep the theme and “add Next”?

That is two fronts to maintain. Migrate or do not. A temporary hybrid becomes years.

Payload / Sanity instead of WP?

If the team is not glued to wp-admin, often cheaper than headless WP. Headless WP makes sense when the WP panel is the requirement.

Summary

Headless WordPress + Next.js pays when you have multiple channels, a hard front, and a team that will own two changelogs. Classic WP pays more often than Twitter suggests. Architecture is not better — it fits or it does not. If you are still choosing a CMS for a company, start with WordPress for business in 2026, not a GraphQL starter repo.