Remove wordpress undesired metaboxes of edit post page

Sometimes you want to remove some metaboxes of the edit page. Place the following code into your functions.php file.

remove_meta_box(<metabox-name>, <post_type>, <WP_Screen $screen>)

Metabox-name is in html code and you can find out just inspecting edit post page.

Wp_screen can be “side” for rigth column metaboxes or “normal” for central metaboxes.

add_action('wp_dashboard_setup', 'disable_my_metabox',99);

function disable_my_metabox() {
    global $post;
    if (is_object($post)) {
      remove_meta_box('metabox-name',$post->post_type,'side');  
    }
}

 

	

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s