Generated with AI Builder
The Builder API plugin should already be installed on your WordPress site from the setup step.
The wp-plugin/builder-api.zip file in this ZIP is included in case you need to reinstall or update it.
To update the plugin:
- Go to WP Admin → Plugins, deactivate and delete the existing Builder API plugin
- Go to Add New Plugin → Upload Plugin, upload
wp-plugin/builder-api.zipand activate
To verify it is working:
curl "https://your-wordpress-site.com/wp-json/builder/v1/page-data?slug=your-page-slug"You should get a JSON response with apiVersion, fields, seo, and meta.
⚠️ Caching warningExclude
/wp-json/builder/v1/*from any caching plugin (WP Rocket, NitroPack, LiteSpeed Cache, etc.) and from Cloudflare if applicable. Without this, content updates will not propagate to the Next.js site correctly.
Open .env.local and update the values before deploying:
WORDPRESS_URL=https://your-wordpress-site.com # URL of your WordPress site (no trailing slash)
WORDPRESS_REVALIDATE_SECONDS=60 # How often pages re-fetch from WordPress
REVALIDATE_SECRET=change-me-before-deploying # Change this to a random secret stringDeploy this project to your preferred hosting platform.
Make sure the environment variables from .env.local are added to your hosting provider's
environment settings (not just the local file).
Visit your deployed site. Content is fetched live from WordPress and cached for
WORDPRESS_REVALIDATE_SECONDS seconds (default: 60).
When you update content in WordPress (manually or via WP All Import from Google Sheets):
- Pages automatically refresh within 60 seconds via Next.js ISR
- To force an immediate update, send a POST request to your revalidation webhook:
curl -X POST https://your-nextjs-site.com/api/revalidate \
-H "Content-Type: application/json" \
-d '{"slug": "your-page-slug", "secret": "your-revalidate-secret"}'Omit slug to revalidate all pages at once.
pnpm install
pnpm devOr with npm:
npm install
npm run devOpen http://localhost:3000 in your browser.
src/app/base.css— shared styles (header, footer, framework), loaded on every routesrc/app/**/page.css— per-route styles, loaded only by that pagesrc/components/pages/— individual page componentssrc/components/templates/— shared templates used across dynamic routessrc/components/layouts/— shared layout sectionspublic/images/— compressed WebP imageswp-plugin/builder-api.zip— WordPress plugin (install on your WP site, not here)