Removing custom meta box added in parent theme

Note: This is the merged version between my and @toscho answers.

Explanation (by @toscho)

Use add_meta_boxes_page as action hook.

You can find the hook in wp-admin/edit-form-advanced.php and it displays as:

do_action('add_meta_boxes_' . $post_type, $post);

Solution(s)

Try the following action, which is inside register_post_type() as well.

function wpse59607_remove_meta_box( $callback )
{
    remove_meta_box( 'id-of-meta-box' , 'page' , 'normal' );
}
add_action( 'add_meta_boxes_page', 'wpse59607_remove_meta_box', 999 );

If you know the exact position where the action, that adds the meta box is registered, you can also just remove this one.

function wpse59607_remove_meta_box()
{
    remove_action( 'admin_menu', 'lala_create_meta_box_page' );
}
add_action( '_admin_menu', 'wpse59607_remove_meta_box', 999 );

Leave a Comment