So, you decided to build a headless WordPress site with a modern frontend framework like Next.js or Astro. It sounds like a great developer experience—until you run into the two notorious roadblocks:
CORS Hell: You spin up your local dev server at http://localhost:4321 or http://localhost:3000, run a fetch request, and... boom. Your browser console is flooded with red CORS policy errors.
Sluggish REST API: Standard WordPress REST API or WPGraphQL boots up the entire WordPress core and queries MySQL on every single request. Response times hover around 300ms to 1s, slowing down your builds and lagging your dynamic server-side fetches.
What if you could turn WordPress into a static JSON generator, serve your API payloads instantly without database queries, and manage CORS headers directly from the admin panel with zero server config?
Here is a look at how to achieve this in under 1 minute using the open-source Static JSON Export & CORS Whitelist plugin.
Alternati
Discussion
Get the discussion rolling
A single comment can start something great.