Remove admin menu for custom taxonomy attached to custom post type

You can use remove_submenu_page(), but getting the submenu slug correct is tricky and it has to be exactly right to work. The correct submenu_slug is not exactly the same as the link you click in the menu, the one in the menu is URL encoded but the slug itself is html encoded, the main difference being in the slug any & chars will instead be &amp

In your example the function call should probably be:

remove_submenu_page( 'edit.php?post_type=portfolio', 'edit-tags.php?taxonomy=featured&post_type=portfolio' );

To really get it right var_dump the submenu variable and you can see the actual slug in use by the system, see https://stackoverflow.com/questions/7610702/wordpress-remove-submenu-from-custom-post-type/ for a worked example.

Leave a Comment