How to Remove Default Meta Boxes from Admin Panel in WordPress
This tutorials helps WordPress developer to remove default meta boxes from WordPress admin panel. To be clarify these default meta boxes are shown in WordPress PAGE & POST types. So the function will work for them.
Open your functions.php file and just copy & paste your necessary remove_meta_box action that you would like to remove from POST or PAGE. Here i given different action hook for Post & Page.
REMOVE META BOXES FROM POSTS SCREEN:
// REMOVE META BOXES FROM DEFAULT POSTS SCREEN add_action('admin_menu','remove_default_post_screen_metaboxes'); function remove_default_post_screen_metaboxes() { remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox remove_meta_box( 'postexcerpt','post','normal' ); // Excerpt Metabox remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments Metabox remove_meta_box( 'trackbacksdiv','post','normal' ); // Talkback Metabox remove_meta_box( 'slugdiv','post','normal' ); // Slug Metabox remove_meta_box( 'authordiv','post','normal' ); // Author Metabox }
REMOVE META BOXES FROM DEFAULT PAGES SCREEN:
// REMOVE META BOXES FROM DEFAULT PAGES SCREEN add_action('admin_menu','remove_default_page_screen_metaboxes'); function remove_default_page_screen_metaboxes() { remove_meta_box( 'postcustom','page','normal' ); // Custom Fields Metabox remove_meta_box( 'postexcerpt','page','normal' ); // Excerpt Metabox remove_meta_box( 'commentstatusdiv','page','normal' ); // Comments Metabox remove_meta_box( 'trackbacksdiv','page','normal' ); // Talkback Metabox remove_meta_box( 'slugdiv','page','normal' ); // Slug Metabox remove_meta_box( 'authordiv','page','normal' ); // Author Metabox }
Hope this hook function helps you if want remove any default meta boxes.
Thanks.
This post has already been read 4508 times!