Remove Taxonomy Menu Items from Dashboard

Occasionally you will use a theme or plugin that adds custom post types and taxonomies to your site. However, there may be taxonomies you don’t want to show up in the WordPress dashboard in an effort to keep things clean.. Here’s a way to hide them from the backend without modifying core files. Add this code to your functions.php file or a custom plugin.




/**************************************************************
* Remove Taxonomy Menu Items from Dashboard
**************************************************************/
function tft_remove_taxonomy_submenu_pages() {

     //make changes to taxonomy and post type as needed
    remove_submenu_page( 'edit.php?post_type=testimonials', 'edit-tags.php?taxonomy=testimonial_author&post_type=testimonials' );
    remove_submenu_page( 'edit.php?post_type=testimonials', 'edit-tags.php?taxonomy=testimonial_category&post_type=testimonials' );
    remove_submenu_page( 'edit.php?post_type=testimonials', 'edit-tags.php?taxonomy=testimonial_image&post_type=testimonials' );
}

add_action( 'admin_menu', 'tft_remove_taxonomy_submenu_pages', 20);


2 thoughts on “Remove Taxonomy Menu Items from Dashboard

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *