I'm trying to conditionally remove the 'Page Attributes' meta box for a specific page (or multiple specific pages). For example:
function remove_meta_boxes() {
if (is_page('contact')) {
remove_meta_box('pageparentdiv', 'page', 'side');
}
}
add_action( 'admin_menu', 'remove_meta_boxes' );
I'm able to remove the Page Attributes meta box for all pages without the conditional statement, so that part is working, but adding the is_page()
condition seems to cause the remove_meta_box()
code not to work. Any help is greatly appreciated.
Thanks!