Single Meta Save

Compress all fields values from the current post, term, user or options into one single meta data. This process lighten the database load as values are saved and read from one single row. Once activated and after saving a post/term/user in the administration, all old meta data will be removed and packed together in a meta called acf.

To monitor the process, it is recommended to enable the Developer Mode to display all WP & ACF meta data on every Posts, Terms, Users & Options.

This module also enables a new setting available in every ACF Fields: “Save as Individual Meta”. WP Queries and Meta Queries can be used normally with ACF Fields only if the “Save as Individual Meta” setting is enabled on the ACF Fields that are queried.

ACF Extended
Howdy, ACF Extended
Edit PageAdd New
WP Custom Fields
NameValue
_edit_last
1
_edit_lock
1611654170:1
acf
Array
(
    [_my_field] => field_5ffd218f27704
    [my_field] => Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui.
)
a:2:{s:9:"_my_field";s:19:"field_5ffd218f27704";s:8:"my_field";s:69:"Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui.";}
Publish
Status: Published
Visibility: Public
Author

Getting Started

The Single Meta Save module is disabled by default. It can be enabled and disabled in the Settings UIPRO, or with the following code:

// Using acf/init
add_action('acf/init', 'my_acfe_modules');
function my_acfe_modules(){

    // Enable Single Meta Save
    acf_update_setting('acfe/modules/single_meta', true);
    
}

// Or using acfe/init
add_action('acfe/init', 'my_acfe_modules');
function my_acfe_modules(){
    
    // Enable Single Meta Save
    acfe_update_setting('modules/single_meta', true);
    
}

Enable on Specific Post Types

Additionally, you can set preferences to only enable the module on specific Post Types, Taxonomies and Options Pages.

// Enable Single Meta Save on specific Post Types only (default: all)
add_filter('acfe/modules/single_meta/post_types', 'my_acfe_single_meta_post_types');
function my_acfe_single_meta_post_types($post_types){

    $post_types = array('page', 'my-post-type');

    // Disable all post types:
    // return false;

    return $post_types;

}

Enable on Specific Taxonomies


// Enable Single Meta Save on specific Taxonomies only (default: all)
add_filter('acfe/modules/single_meta/taxonomies', 'my_acfe_single_meta_taxonomies');
function my_acfe_single_meta_taxonomies($taxonomies){

    $taxonomies = array('category', 'my-taxonomy');

    // Disable all taxonomies:
    // return false;

    return $taxonomies;

}

Enable on Specific Options Pages


// Enable Single Meta Save on specific Options Post ID (default: disabled)
add_filter('acfe/modules/single_meta/options', 'my_acfe_single_meta_options');
function my_acfe_single_meta_options($options_ids){

    $options_ids = array('options', 'my-option-id');

    // Disable all options id (default behavior)
    // return false;

    return $options_ids;

}

Revert Back

It is possible to revert back to the native ACF save process. To do so, keep the feature enabled, get in the post administration you want to revert back. Disable the feature in your code, and save the post. All data will be saved back to individual meta data.