What this prompt does
This prompt sets up a headless WordPress backend feeding a Next.js [nextjs_version] frontend. On the backend it configures WPGraphQL, exposes [post_types] to GraphQL, maps ACF fields, enables preview mode for drafts, and wires a publish webhook to trigger [revalidation_method]. On the frontend it uses the App Router with your [rendering_strategy], a [graphql_client], dynamic routes for [content_types], SEO via next-seo plus Yoast data, and image optimization proxying WordPress media.
The structure works because decoupling WordPress means deliberately rebuilding the things you lose — preview, SEO continuity, and media handling. Mapping ACF to GraphQL keeps the editor's custom fields available in React. The [rendering_strategy] decides freshness versus speed per content type, and the publish webhook plus [revalidation_method] is what makes on-demand ISR update pages the moment an editor hits publish.
When to use it
- You want the WordPress editor experience with a React/Next.js frontend
- You need
[post_types]and ACF fields exposed cleanly through WPGraphQL - You want draft preview working across the decoupled boundary
- You need on-demand revalidation via
[revalidation_method]triggered on publish - You're choosing a
[rendering_strategy]that balances freshness and speed per content type - You care about preserving SEO and media optimization after decoupling
Example output
Expect a two-part setup: a configured WPGraphQL backend with [post_types] and ACF mapped to GraphQL, preview mode, and a publish webhook; plus a Next.js App Router frontend using [graphql_client], your [rendering_strategy], dynamic routes for [content_types], next-seo wired to Yoast data, media proxying, sitemap generation, and search via [search_approach], ready to deploy on [hosting].
Pro tips
- Match
[nextjs_version]to a version you'll actually run; App Router behavior and ISR APIs shift between releases - Map every ACF field you need to GraphQL explicitly — unmapped fields silently vanish from the frontend
- Tune
[rendering_strategy]per content type; ISR for fast-changing posts and SSG for stable pages is a sensible split - Verify the publish webhook and
[revalidation_method]actually fire end-to-end before relying on them - Don't skip SEO continuity — proxy Yoast data and preserve URLs, or you'll lose ranking equity in the move
- Test preview mode auth carefully; a misconfigured preview exposes drafts publicly