Advanced Custom Fields (ACF) version 6.6 introduces ACF Blocks v3, which brings a new editing experience for blocks, compatible with the Block iFrame. While this is a fantastic feature for many use cases, there are times when you simply want to force editors to click “Edit” and work directly with the block fields—no preview, no iframe rendering, just a quick way to jump into the edit form.
If you’ve disabled mode support and set your block to edit mode by default in your v2 blocks, this is no longer natively supported in blocks v3.
The Solution
It is still possible to achieve a similar behaviour to how you used ACF Blocks v2. You can use a custom callback to trigger the conditions that make the preview act as if no render template is available, and show a simple “Edit Block” button instead.
I’ve created some sample code (as a plugin) that intercepts ACF’s block registration process and prevents preview rendering when you’ve requested it be not work, like in v2. You can find the complete code here: ACF Blocks v3 Disable Preview Plugin
How It Works
1. Hook Interception at the Right Moment
By hooking into register_block_type_args at priority 98 (just before ACF’s priority 99), the plugin can inspect and modify block registration arguments after ACF has processed them.
2. Smart Callback Replacement
When the plugin detects a block that meets the criteria (v3 block with mode support disabled and edit mode configured), it replaces the render callback with a custom function that:
- Returns ACF’s special
'acf-block-preview-no-html'value in the editor context - This triggers the
NoBlockPreviewPlaceholdercomponent, displaying a clean “Edit Block” button - On the frontend, it calls ACF’s original render function normally
Installation
Simply grab the plugin from the gist, drop it into your wp-content/plugins directory, and activate it. It automatically detects and handles all qualifying ACF Blocks v3 that you want to disable the preview mode for throughout your site.
No configuration needed—it just works, or you could copy the code into your own themes or plugins.
Leave a Reply
You must be logged in to post a comment.