How to remove default Taxonomies in WordPress

WordPress Snippets

To remove default taxonomies in WordPress using the functions.php file, you can use the unregister_taxonomy() function. This function is part of the WordPress core and can be used to unregister any taxonomy that has been registered by WordPress or a plugin. Here is an example of how you can use unregister_taxonomy() to remove the default “category” taxonomy using theme functions.php:

// How to remove default Taxonomies in WordPress
// More snippets at wpunplugged.com 

function remove_default_taxonomies() {
    unregister_taxonomy('category');
}
add_action('init', 'remove_default_taxonomies');

You can also use this function to remove other default taxonomies in WordPress, such as post_tag or link_category, by replacing ‘category’ with the name of the taxonomy you want to remove.

It’s important to note that unregistering a taxonomy will also remove any terms associated with that taxonomy. If you only want to remove the taxonomy from the admin interface, you can use the ‘admin_init’ action instead of ‘init’ to only remove the taxonomy from the admin interface.

Share this post

You might also like...

Pre-built websites in BeTheme
Themes

Betheme for WordPress Review

Betheme is a WordPress theme that has been described as one of the most powerful and versatile themes available for WordPress. In this Betheme for

Read More »

Comment

Your email address will not be published. Required fields are marked *