I'm trying to create a taxonomy that is sort of hidden.. meaning i intend to adjust the metabox so that you can only select a unique term from 3 options. "featured","normal" or "excluded". but i can't figure out how to remove the administration menu.

the following removes the Tags menu item from underneath Posts:

function yoursite_admin_menu() {
    // remove_submenu_page was introduced in 3.1
    remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=post_tag' );

but this doesn't remove the Featured taxonomy from underneath Portfolio

function yoursite_admin_menu() {
    // remove_submenu_page was introduced in 3.1
    remove_submenu_page( 'edit.php?post_type=portfolio', 'edit-tags.php?taxonomy=featured&post_type=portfolio' );

i've tried it a couple of different ways w/ regards to the slugs, but can't get any of them to work. what am i missing?

  • 1
    Why not set the show_II argument of the register_taxonomy to false and create a custom Meta box with just your 3 terms?
    – Bainternet
    Jul 9, 2011 at 23:06
  • b/c that would have been too clever by half! :) works perfectly as i was creating a custom metabox w/ radio buttons anyway. Jul 9, 2011 at 23:51
  • wish i could mark your comment as the solution. Feb 17, 2012 at 15:10
  • Post it as an answer yourself for future askers with the same issue. that would be thanks enough :)
    – Bainternet
    Feb 17, 2012 at 15:38

3 Answers 3


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.

  • thanks for the response. i was able to sort it with Bainternet's comment about registering the taxonomy with show_ui set to false and then adding my own metabox. but your solution is clever. Jan 9, 2012 at 23:07

This maybe old, and possibly even at the time of the original question not available but..

If you look in wp-includes/taxonomy.php there is a show_in_menu option for the register_taxonomy() hook that was left out of WordPress's documentation.

  • show_in_menu - Whether to show the taxonomy in the admin menu.
    • If true, the taxonomy is shown as a submenu of the object type menu.
    • If false, no menu is shown.
    • show_ui must be true.
    • If not set, the default is inherited from show_ui.

Thought I would just leave this here for anyone looking for the answer :)

  • This was the simplest solution for me.
    – jrh
    Jul 20, 2023 at 2:30

following Bainternet's comment, i registered the taxonomy without showing any of the UI elements

add_action( 'init', 'kia_register_featured_tax', 0 );

function kia_register_featured_tax(){
        $labels = array(
            'name' => _x( 'Featured', $this->plugin_domain ),
            'singular_name' => _x( 'Featured', $this->plugin_domain )           

        $args = array(
            'labels' => $labels,
            'rewrite' => array( 'slug' => 'portfolio-featured' ),
            'query_var' => true,
            'public' => true,
            'show_ui' => false,
            'show_tagcloud' => false,
            'show_in_nav_menus' => false,
        register_taxonomy( 'portfolio_featured', array( 'portfolio' ), $args );
  • But how did you show the metabox?I don't want the link in the admin menu but i do want the metabox when i add a new "event" ( which is a custom post type ) Jan 14, 2015 at 12:16
  • Unfortunately since this question is so old, I have no idea what I did then. But to add a metabox, you can always use add_meta_box(). Jan 14, 2015 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.