Disable all meta settings of page/post by default

Astra meta settings are page specific settings. These settings allow you to disable Astra sections on a particular page/post. In case you need to disable page meta settings permanently (all boxes checked) use the following filter.

Add the following custom code to the child theme’s functions.php file.

add_filter( 'astra_meta_box_options', 'default_disable_options' );

/**
* Default disable the Meta Options
*
* @param array $meta_option Page Meta.
* @return array
*/
function default_disable_options( $meta_option ) {

    $meta_option['ast-main-header-display'] = array(
            'default'  => 'disabled',
            'sanitize' => 'FILTER_DEFAULT',
    );
    $meta_option['footer-sml-layout'] = array(
            'default'  => 'disabled',
            'sanitize' => 'FILTER_DEFAULT',
    );
    $meta_option['footer-adv-display'] = array(
            'default'  => 'disabled',
            'sanitize' => 'FILTER_DEFAULT',
    );
    $meta_option['site-post-title'] = array(
            'default'  => 'disabled',
            'sanitize' => 'FILTER_DEFAULT',
    );
    $meta_option['site-sidebar-layout'] = array(
            'default'  => 'disabled',
            'sanitize' => 'FILTER_DEFAULT',
    );
    $meta_option['site-content-layout'] = array(
            'default'  => 'disabled',
            'sanitize' => 'FILTER_DEFAULT',
    );
    $meta_option['ast-featured-img'] = array(
            'default'  => 'disabled',
            'sanitize' => 'FILTER_DEFAULT',
    );
    $meta_option['ast-breadcrumbs-content'] = array(
            'default'  => 'disabled',
            'sanitize' => 'FILTER_DEFAULT',
    );
    
    return $meta_option;
}
Not the solution you are looking for? Check other articles, or open a support ticket.