I've worked out how to add tags to custom post types using
'taxonomies' => array('post_tag')
However this adds another "Tags" submenu under my custom post type menu which I do not want. How do I remove this submenu?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityTo remove the submenu Tags link from the admin menu, you might try
add_action( 'admin_menu', 'custom_admin_menu' );
function custom_admin_menu() {
// debug to find the correct submenu slug:
// global $submenu;
// print_r($submenu);
$menu_slug = 'edit.php?post_type=infographics';
$submenu_slug = 'edit-tags.php?taxonomy=post_tag&post_type=infographics';
remove_submenu_page( $menu_slug, $submenu_slug );
}
if your custom post type is infograhpics.
By viewing the global $submenu
array you can find the correct menu slugs.