I’ve wanted to remove the GeneratePress layout metabox in the sidebar for a while in my starter site, as I control everything using my own layout / template system, and it causes more confusion than it solves.
This handy snippet allows you to disable it everywhere.
Code Snippet
Add the code below to functions.php
or code snippet plugin.
/** * Remove GP Layout Metabox * * @source SnippetClub * @author Taylor Drayson */ function tct_remove_gp_layout_metabox() { $post_types = get_post_types( array( 'public' => true ) ); remove_meta_box( 'generate_layout_options_meta_box' , $post_types , 'side' ); } add_action( 'admin_head' , 'tct_remove_gp_layout_metabox' );
Copy
By default, this snippet excludes the metabox on every single public registered post type.
If you wanted to exclude only certain post types, you could modify the $post_types
line with:
$post_types = array('post', 'page');
Copy
This way you pass in the post types you want to remove it from.