ACF Blocks and Gutenberg Control Blocks (GCB) are built on the same idea: a PHP template plus a list of fields, with no React. That makes moving across mostly a matter of renaming things. There's no importer for ACF blocks in GCB, so you move one block at a time, by hand. This guide shows how a block maps across, and what to do about pages that already use it.
What maps to what
| ACF Blocks | GCB | |
|---|---|---|
| Metadata | block.json with an acf key for the mode and template | Plain block.json, nothing GCB-specific in it |
| Fields | A field group with the location rule "Block is equal to …" | block.fields.json in the block's folder |
| Template | Reads values with get_field() | render.php reads $attributes |
| Block name | Whatever block.json says | gcb/ plus the folder name |
| Where it lives | Registered with register_block_type() | blocks/{name}/ in your theme, found and registered for you |
1. Make the folder
Create blocks/testimonial/ in your theme. Copy the block.json across, change the name to gcb/testimonial, and delete the acf key. Leave attributes empty, because GCB makes them from your fields. You don't need a render line either, as GCB finds render.php in the folder.
{ "apiVersion": 3, "name": "gcb/testimonial", "title": "Testimonial", "category": "widgets", "icon": "format-quote"}If you'd rather start clean, Gutenberg Control Blocks → Blocks → + New, or wp gcblite scaffold, writes the folder for you.
2. List the fields
Each field in the ACF field group becomes one entry in block.fields.json. Keep the field names as the attributeKey, and the template changes stay small.
{ "controls": [ { "id": "c_quote", "type": "textarea", "label": "Quote", "attributeKey": "quote", "validation": { "required": true } }, { "id": "c_author", "type": "text", "label": "Author", "attributeKey": "author" }, { "id": "c_photo", "type": "image", "label": "Photo", "attributeKey": "photo" } ]}Most ACF field types have a direct match:
| ACF field | GCB field type |
|---|---|
| Text, Text Area, Email, Number, Range | text, textarea, email, number, range |
| Wysiwyg Editor | richtext (wysiwyg also works) |
| True / False | toggle |
| Select, Radio Button, Checkbox | select, radio, checkbox-group |
| Button Group | toggle-group for one choice, button-group for several |
| Link, URL, Page Link | url |
| Image, Gallery, File, oEmbed | image, gallery, file, oembed |
| Color Picker | color, which offers your theme's palette |
| Date Picker, Date Time Picker | date, datetime |
| Post Object, Relationship, Taxonomy, User | post-object, taxonomy, user |
| Google Map, Icon Picker | google-map, icon |
| Group, Tab, Accordion | A group panel. It arranges the sidebar and stores nothing. |
| Repeater | A repeater field, or child blocks on the canvas |
| Flexible Content | Child blocks, with an <InnerBlocks> area that allows each layout's block |
Flexible Content is the one that changes shape. Each layout becomes a small block of its own, and your client adds them on the canvas. The repeater guide helps you choose between a repeater field and child blocks.
3. Change the template
Copy the ACF template into render.php. Replace each get_field('name') with $attributes['name'], and echo get_block_wrapper_attributes() on the outer element. Before:
<?php $quote = get_field('quote'); $author = get_field('author'); ?><blockquote class="testimonial"> <p><?php echo esc_html($quote); ?></p> <cite><?php echo esc_html($author); ?></cite></blockquote>After:
<?php$quote = $attributes['quote'] ?? '';$author = $attributes['author'] ?? '';$photo = $attributes['photo'] ?? [];?><blockquote <?php echo get_block_wrapper_attributes(['class' => 'testimonial']); ?>> <?php if (!empty($photo['url'])) : ?> <img src="<?php echo esc_url($photo['url']); ?>" alt="<?php echo esc_attr($photo['alt'] ?? ''); ?>"> <?php endif; ?> <p data-gcb-field="quote" data-gcb-field-type="text"><?php echo esc_html($quote); ?></p> <cite data-gcb-field="author" data-gcb-field-type="text"><?php echo esc_html($author); ?></cite></blockquote>Three things to watch:
- Value shapes.
$attributesholds the stored value of each field. An image is an object (url,alt,width,height,idand its focal point), and aurlfield is{ url, text, opensInNewTab }. Each field page lists its shape. - Escaping. Escape every value as you print it.
- Editing on the page. The
data-gcb-fieldattributes are optional. With them, your client types the quote where it sits.
Your template variables change as well. GCB's render.php gets $attributes, $content and $block, like a core block's PHP render.
4. Move the pages that use it
This is the part to plan. Pages built with ACF keep the ACF block name, and by default ACF keeps the block's values in the block's HTML comment in the post content. Adding a GCB block doesn't change those pages. They still use the ACF block until you move them, and if you turn ACF off first, WordPress can't render them.
You have two ways to move them:
- By hand. For a few pages, insert the GCB block, copy the words and pictures across, and delete the old block.
- With a one-off script. For many pages, rename the blocks and rewrite their values with WordPress's own
parse_blocks()andserialize_blocks().
Open a page in the Code editor first to see exactly how your ACF version saved the block, then write the script to match:
<?php// Back up the database, then run once: wp eval-file move-testimonials.phpfunction move_testimonials(array $blocks): array { foreach ($blocks as &$block) { if ($block['blockName'] === 'acf/testimonial') { $old = $block['attrs']['data'] ?? []; // match what the Code editor shows $block['blockName'] = 'gcb/testimonial'; $block['attrs'] = [ 'quote' => $old['quote'] ?? '', 'author' => $old['author'] ?? '', ]; } $block['innerBlocks'] = move_testimonials($block['innerBlocks']); } return $blocks;} foreach (get_posts(['post_type' => 'any', 'post_status' => 'any', 'numberposts' => -1]) as $post) { if (strpos($post->post_content, '<!-- wp:acf/testimonial') === false) continue; $content = serialize_blocks(move_testimonials(parse_blocks($post->post_content))); wp_update_post(wp_slash(['ID' => $post->ID, 'post_content' => $content]));}Keep these in mind when you run it:
- Rich values need building. Text copies straight across. An image, link, gallery or repeater needs the shape the GCB field stores. For an image, that means looking up the attachment and building the object.
- Not everything is a post.
'any'leaves out some post types, such as synced patterns and Site Editor templates. Run those separately, and update any ACF block names in your theme's template files by hand. - Values in post meta. A block registered with
usePostMetakeeps its values in post meta, not in the block. Read them from there.
Keep ACF active until every page is moved. Then check each block in the editor before you switch it off.
GCB's Move content tool (on the Eject page) only moves GCB blocks to an ejected plugin. It doesn't read ACF blocks.
What you get after the move
- Your client edits text, images and links on the canvas, including repeater rows.
- A block can have more than one InnerBlocks area.
- Validation rules stop a page saving until a required field is filled.
- Eject turns your blocks into plain WordPress blocks if you ever leave.
GCB and ACF Blocks compared sets the two side by side.
Try it
The Quickstart builds a first block. Writing a block covers block.json, block.fields.json and render.php, and the field reference has every field type and its stored value.
Checked against ACF's own docs and release notes on 27 November 2026: ACF Blocks in ACF 6, Create your first ACF block, ACF field types, ACF 6.3 release (post meta storage).