Created
June 26, 2016 22:13
-
-
Save certainlyakey/96ef970e48567d30dd286b00f85cf6bd to your computer and use it in GitHub Desktop.
Completely remove vanilla Wordpress tags and categories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Remove categories and tags | |
| function unregister_categories() { | |
| register_taxonomy( 'category', array(), array('show_in_nav_menus' => false) ); | |
| } | |
| add_action( 'init', 'unregister_categories' ); | |
| unregister_widget( 'WP_Widget_Categories' ); | |
| function unregister_tags(){ | |
| register_taxonomy('post_tag', array(), array('show_in_nav_menus' => false)); | |
| } | |
| add_action('init', 'unregister_tags'); | |
| function remove_tagmenu(){ | |
| remove_menu_page('edit-tags.php?taxonomy=post_tag'); // Post tags | |
| } | |
| add_action( 'admin_menu', 'remove_tagmenu' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Theres an issue, if you test a url with
/category/fake-category/it will give all the posts instead of 404 page