-
Home
-
Pages with category and tag
- Tips
How to Hide Pages with category and tag Admin Menus
function plt_hide_pages_with_category_and_tag_menus() {
//Hide the "Pages → Categories" menu.
remove_submenu_page('edit.php?post_type=page', 'edit-tags.php?taxonomy=category&post_type=page');
//Hide the "Pages → Tags" menu.
remove_submenu_page('edit.php?post_type=page', 'edit-tags.php?taxonomy=post_tag&post_type=page');
}
add_action('admin_menu', 'plt_hide_pages_with_category_and_tag_menus', 15);
Where do I put this code?
How to Hide Pages with category and tag Meta Boxes
function plt_hide_pages_with_category_and_tag_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Categories" meta box.
remove_meta_box('categorydiv', $screen->id, 'side');
//Hide the "Tags" meta box.
remove_meta_box('tagsdiv-post_tag', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_pages_with_category_and_tag_metaboxes', 20);