Unregister WordPress Taxonomy – Remove Category or Tag

There’s no direct method to Unregister WordPress taxonomy such as category, post_tag or any custom taxonomy. Here’s a simple function that can be used to Unregister WordPress Taxonomy simply

Code Snippet

add_action( 'init', 'unregister_taxonomy' );
function unregister_taxonomy()
    global $wp_taxonomies;
    $taxonomy = 'taxonomy_to_remove';
    if ( taxonomy_exists($taxonomy) )
        unset( $wp_taxonomies[$taxonomy] );


To unregister a taxonomy, copy the code and paste to your themes functions.php or plugin. Then replace the ‘taxonomy_to_remove’ with your desired taxonomy name.

Break it down

$wp_taxonomies is a global variable which holds all of the taxonomies information. Each taxonomy information is kept on $wp_taxonomies array using the taxonomy name as the key. And we are removing taxonomy from the global variable by that key.