Overview
Enables the ACF datastore, which integrates ACF fields with Gutenberg’s native wp.data store. When enabled, ACF field values are saved through WordPress’s REST API instead of the legacy metabox AJAX request.
The datastore unlocks several capabilities:
- Full revision support for ACF fields
- Autosave integration
- JavaScript API via
wp.data.select('acf/fields')andwp.data.dispatch('acf/fields') - Live preview and editing for block bindings
This filter requires WordPress 6.7 or later.
Changelog
- Added in version 6.8.1
Parameters
This filter has no additional parameters. Return true to enable, false to disable.
Example
Enable the datastore for all posts:
add_filter( 'acf/settings/enable_datastore', '__return_true' );
Enable conditionally for specific post types:
add_filter( 'acf/settings/enable_datastore', function( $enabled ) {
// Only enable for products and pages
$post_type = get_post_type();
if ( in_array( $post_type, array( 'product', 'page' ) ) ) {
return true;
}
return $enabled;
});
Disable after previously enabling (useful for troubleshooting):
add_filter( 'acf/settings/enable_datastore', '__return_false', 100 );
Notes
- The datastore is disabled by default
- Currently available in ACF PRO only
- Custom JavaScript hooked into ACF’s legacy metabox save events may need to be updated to work with Gutenberg’s REST save flow
- We recommend testing thoroughly in a staging environment before enabling on production sites
Related
- Using the ACF Datastore – Full guide to the datastore feature
- Block Bindings – Using ACF fields with WordPress block bindings
Supercharge Your Website With Premium Features Using ACF PRO
Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.
Related
- Features: Using the ACF Datastore
- Integrations: Block Bindings
- Features: Abilities API Integration
- Field Types: User
- Features: WP REST API Integration