Skip to content

Instantly share code, notes, and snippets.

@certainlyakey
Created June 26, 2016 22:13
Show Gist options
  • Select an option

  • Save certainlyakey/96ef970e48567d30dd286b00f85cf6bd to your computer and use it in GitHub Desktop.

Select an option

Save certainlyakey/96ef970e48567d30dd286b00f85cf6bd to your computer and use it in GitHub Desktop.
Completely remove vanilla Wordpress tags and categories
//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' );
@h0r0m4n

h0r0m4n commented Jul 12, 2016

Copy link
Copy Markdown

Theres an issue, if you test a url with /category/fake-category/ it will give all the posts instead of 404 page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment