Remove Meta Boxes in Genesis Theme Settings

You can remove the metaboxes that appear in the Genesis theme settings in the WordPress dasgboard – this may help when you want an end user not to use or change certain theme settings.

genesis-meta-box

<?php
add_action( 'genesis_admin_before_metaboxes', 'wpb_remove_unwanted_genesis_metaboxes' );
/**
* Remove various metaboxes of Genesis Theme Settings
* More metaboxes appear see @filesource genesis/admin/theme-settings.php
* @param metaboxes()
* @see https://fewerthanthree.com/code-snippets/remove-blog-page-settings-genesis-theme-settings/
*
*/
function wpb_remove_unwanted_genesis_metaboxes() {
remove_meta_box( 'genesis-theme-settings-version', 'toplevel_page_genesis', 'main' );
remove_meta_box( 'genesis-theme-settings-feeds', 'toplevel_page_genesis', 'main' );
remove_meta_box( 'genesis-theme-settings-layout', 'toplevel_page_genesis', 'main' );
remove_meta_box( 'genesis-theme-settings-nav', 'toplevel_page_genesis', 'main' );
remove_meta_box( 'genesis-theme-settings-breadcrumb', 'toplevel_page_genesis', 'main' );
remove_meta_box( 'genesis-theme-settings-comments', 'toplevel_page_genesis', 'main' );
remove_meta_box( 'genesis-theme-settings-posts', 'toplevel_page_genesis', 'main' );
remove_meta_box( 'genesis-theme-settings-blogpage', 'toplevel_page_genesis', 'main' );
remove_meta_box( 'genesis-theme-settings-scripts', 'toplevel_page_genesis', 'main' );
remove_meta_box( 'genesis-theme-settings-header', 'toplevel_page_genesis', 'main' );
}
view raw remove-meta.php hosted with ❤ by GitHub

In this Gist are the main ones just include the ones that you need to remove – any settings that have already been added are not lost, if you bring the metabox back the settings will be present.

Some more theme settings metaboxes may be present if certain theme supports are active, refer to genesis/admin/theme-settings.php for more.

Leave a Comment





%d bloggers like this: