Articles WordPress Development

Why I Switched to Headless WordPress + Astro — And What I Learned

November 10, 2026

A client came to me with a problem that felt simple: their WordPress site loaded in 4.2 seconds on mobile. Good design, solid content, clean theme — just slow. After the usual fixes (caching, image compression, CDN), I was still stuck at 2.1 seconds. Good enough for most projects, but not what they needed. That problem pushed me toward headless WordPress, and what I found there changed how I think about building sites.

What headless WordPress actually means

Headless WordPress means you keep WordPress for what it’s genuinely good at — the admin interface, the content editor, media management, CPTs, ACF fields — and serve the public-facing website through a completely separate frontend. WordPress becomes an API layer. Your frontend framework (in this case, Astro) fetches content from the REST API and renders it into HTML.

The “head” in headless is the browser-facing layer: the HTML, the design, the user experience. When you decouple that from WordPress and hand it to a framework built specifically for frontend performance, you get different — and usually better — results on the metrics that matter.

Where traditional WordPress hits its ceiling

Standard WordPress generates pages by running PHP on every request. It queries the database, runs all the hooks from your theme and plugins, assembles the HTML, and sends it back. This works fine for most sites. But when you need consistent sub-two-second loads on slow mobile connections with cold cache, you’re fighting the architecture itself.

Even well-optimised traditional WordPress sites have overhead you can’t engineer away: PHP execution time, MySQL query time, the WordPress bootstrap process itself. You can cache the final HTML, but the first user after a cache expiry gets the full dynamic render. On shared hosting or underpowered servers, that’s a real problem.

Why I chose Astro over React or Next.js

I’d looked at headless WordPress with React before. The appeal was obvious, but the complexity felt out of proportion for most client projects. A React SPA means client-side rendering, state management, and either a heavy Next.js setup or accepting poor SEO without server-side rendering.

Astro takes a fundamentally different position. It generates static HTML at build time and ships zero JavaScript by default. The home page becomes a plain HTML file sitting on a CDN. When a user requests it, they get a pre-built document from a server near them — no PHP, no database, no server round-trip at all.

When you need interactivity — a filterable project list, a contact form — Astro’s “islands architecture” lets you drop in a React or Svelte component for just that part. Everything else stays pure HTML. You pay the JavaScript cost only where you actually need it.

What actually changed for that client

After migrating to headless WordPress with Astro deployed to Cloudflare Pages, the mobile Lighthouse score went from 54 to 96. Time to First Byte dropped from 1.4 seconds to under 100ms. Largest Contentful Paint — the Core Web Vitals metric Google weights most heavily — went from 4.1 seconds to 0.8 seconds.

The client’s content team noticed nothing different. They write in WordPress, publish the same way. The only visible change on their end was a build notification after they hit “Publish.” The invisible change was their readers getting the page in under a second, every time, from anywhere in the world.

When it makes sense (and when it doesn’t)

Headless WordPress with Astro isn’t universal. The build step — where Astro fetches all content from the API and generates HTML — means content changes don’t go live instantly. Publish a post and it takes 30 seconds to a few minutes to rebuild and redeploy. For a news site publishing breaking updates, that delay is a real constraint.

It makes sense when: performance is a primary business requirement, content changes happen on a timescale of hours rather than seconds, and you want your infrastructure costs to drop significantly. CDN hosting is a fraction of the cost of a managed PHP server.

If you’re building a portfolio, a business site, or an agency property where “fast and always available” matters more than real-time publishing, the combination of WordPress’s editorial experience and Astro’s static delivery is genuinely difficult to beat.