Headless rendering
GCB Lite is built for a headless setup: WordPress holds the content, a React frontend (Next.js, Astro, Remix — anything that can run a component server) renders it. The same React components power both the WordPress block editor preview AND the public site.
The end-to-end flow
- Edit in WP — author drops blocks on a page. Each block's
block.fields.jsonrenders an Inspector panel; values save as typed WP attributes. - Persist as block markup — WP writes the page as a sequence of HTML comments:
<!-- wp:gcb/foo {...} /-->. - Fetch via REST — your Next.js frontend fetches the page, reads its
blocks_rawfield (added by gcb-lite's REST extension) or falls back tocontent.rendered. - Parse — use
@wordpress/block-serialization-default-parserto turn block markup into a tree of{ blockName, attrs, innerBlocks }. See Block parser. - Dispatch — walk the tree and look up each block in your
WP_BLOCK_REGISTRY. Render the matching React component with the parsed attributes. See Block registry. - Section blocks fetch their own data — a brands strip block hits the brand CPT collection; a blog grid block hits
/wp/v2/posts. UsegetCptCollection(postType, attrs)to mirror the plugin's PHP Collection helper. See Collection helper.
Why this matters
The classic Gutenberg setup has two render paths: an edit.js for the editor and a save.js (or PHP render.php) for the frontend. They drift. The editor previews one thing, the public site renders another, and the editor lies about what readers will see.
GCB Lite collapses both into a single React component. The plugin SSRs your component server's output INTO the editor preview, so the preview IS the live site, fed by the live attributes. No edit.js to maintain.
This is the differentiator vs. WordPress 7's declarative inspector controls. The inspector surface alone is becoming commoditised. The editor/frontend parity story is the moat.
Read on
- Block parser — turning block markup into a tree.
- Block registry — dispatching to React components.
- Collection helper — fetching CPT records from inside a section block.
- Deploy — Vercel + WP-on-Kinsta and other patterns.