Hide custom post type from nav menu manager

// set up the arguements for post type
$labels = array(....);
$args =
        array(
            'labels' => $labels,
            'public' => true, // display on menu and site
            'publicly_queryable' => false,
            'show_ui' => true,
            'query_var' => false,
            'rewrite' => false,
            'capability_type' => 'post',
            'hierarchical' => false,
            'menu_position' => 111,
            'supports' =>
            array(
                'title'
            )
);
// register the post type
register_post_type(__('galery'), $args);

If the 'public' => true is true, then a post type will appear in the menu and site.

If the 'public' => false – hidden in the menu and site.

If you want to show on the site but hidden in the menu, there is a special option: 'show_in_nav_menus' => true

Example:

$labels = array(....);
    $args =
            array(
                'labels' => $labels,
                'public' => true, // display on menu and site
                'show_in_nav_menus' => false // hiden on menu
                'publicly_queryable' => false,
                'show_ui' => true,
                'query_var' => false,
                'rewrite' => false,
                'capability_type' => 'post',
                'hierarchical' => false,
                'menu_position' => 111,
                'supports' =>
                array(
                    'title'
                )
    );
    // register the post type
    register_post_type(__('payout'), $args);

If you can not edit register_post_type You can Hide use css.
To click in the browser f12 and find id element:

enter image description here

in my case, to add to the styles admin:

    #add-kleo-nav-menu {
    display: none;
}

If there is a question how to add styles in admin area – ask.

Sorry for my English.

Leave a Comment

tech