How to Safely Remove Product Tags in WooCommerce

Product tags – is a custom taxonomy created by WooCommerce. The thing is that it is partly hardcoded, if you would try to deregister it, something can go wrong. So we are going to hide the products tags everywhere! No CSS of course.

/2 comments

What if your client do not need product tags on his/hers WooCommerce store? Or maybe he/she uses tags inappropriately, instead of using product categories for example?

That’s why it is always better to hide or remove all the unnecessary functionality from WordPress admin area.

Let’s do it! But before doing anything from this tutorial, please go to Products > Tags and make sure, that no tags are there.

All the code from this post can go to your theme functions.php or to your child theme functions.php (preferable) or to a custom plugin.

Hide “All Products > Tags” Link from Admin Menu

The first and the most obvious step – we have to remove the link to product tags page from the admin menu.

It can be done quite simple with remove_submenu_page() function.

add_action( 'admin_menu', 'misha_hide_product_tags_admin_menu', 9999 );
 
function misha_hide_product_tags_admin_menu() {
	remove_submenu_page( 'edit.php?post_type=product', 'edit-tags.php?taxonomy=product_tag&post_type=product' );
}

As you can see no Tags link there anymore:

Remove WooCommerce product tags from admin menu

Remove Product tags Metabox

If you go to a certain product edit page, you will find the “Product tags” metabox there which is similar to WordPress “Tags” metabox.

Product tags metabox in WooCommerce

It is critical to remove it, because it allows not only to choose from available tags but also to create new ones.

Yes, yes, I know, that we can hide it in Screen Options but it is not enough. Here is the code that removes it completely.

add_action( 'admin_menu', 'misha_hide_product_tags_metabox' );
 
function misha_hide_product_tags_metabox() {
	remove_meta_box( 'tagsdiv-product_tag', 'product', 'side' );
}

Remove Tags Column from All Products page

Here is the column I’m going to remove

Tags column on All Products page in WooCommerce

Once again – it is also possible to turn off it in Screen Options, but what if your website has multiple users?

The code is below.

add_filter('manage_product_posts_columns', 'misha_hide_product_tags_column', 999 );
 
function misha_hide_product_tags_column( $product_columns ) {
	unset( $product_columns['product_tag'] );
	return $product_columns;
}

Remove Product Tags Textarea from Quick Edit and Bulk Edit

I’ve seen a couple examples on other websites where it is suggested to do with CSS or even JS, please don’t!

There is a hook for that! 🎉🕺

add_filter( 'quick_edit_show_taxonomy', 'misha_hide_product_tags_quick_edit', 10, 2 );
 
function misha_hide_product_tags_quick_edit( $show, $taxonomy_name ) {
 
    if ( 'product_tag' == $taxonomy_name )
        $show = false;
 
    return $show;
 
}

As you can see, here a hook quick_edit_show_taxonomy, which allows to properly remove any taxonomy from both Quick Edit and Bulk Edit forms, here is an example how I removed Product Tags:

Remove Product Tags from both Bulk and Quick edit in WooCommerce

Remove Product Tag Cloud Widget

The last but not least – “Product tag cloud” widget. Not every WooCommerce theme supports widgets, but if your theme does – do not forget to include this code to your functions.php too.

add_action( 'widgets_init', 'misha_remove_product_tag_cloud_widget' );
 
function misha_remove_product_tag_cloud_widget(){
	unregister_widget('WC_Widget_Product_Tag_Cloud');
}

If I forgot about something in this tutorial, please let me know in comments.

Read also

Misha Rudrastyh

Misha Rudrastyh

I love WordPress, WooCommerce and Gutenberg so much. 10 yrs of experience.

Need some custom developer help? Let me know

Follow Misha

Need some help with WooCommerce?

If you need some professional developer help, I will be happy to assist you.

Contact me Who I am?

Comments — 2

Leave a comment

php js HTML CSS Code