I'm creating different custom post types and taxonomies and I want to remove the 'Post Tags' taxonomy from the default 'Posts' post type. How do I go about doing this?
Thanks.
I'm creating different custom post types and taxonomies and I want to remove the 'Post Tags' taxonomy from the default 'Posts' post type. How do I go about doing this?
Thanks.
Use it in 'admin_init' hook insetead not 'init'
add_action('admin_menu', 'remove_menu_items'); function remove_menu_items() { remove_submenu_page('edit.php','edit-tags.php?taxonomy=post_tag'); }
Perhaps a more technically correct method would be to use
unregister_taxonomy_for_object_type
Where it says '
taxonomy_to_remove
' is where you'll enter the taxonomy you want to remove. For instance you can replace it with the existing,post_tag
orcategory
.Total unregister and remove (minimal PHP version 5.4!)
I suggest you don't mess with the actual global. Its safer to simply deregister the taxonomy from the post type: register_taxonomy is used for both creation and modification.
To remove the sidebar menu entry: