How to Hide Tags In Storefront Theme WooCommerce

How to Hide Tags In Storefront Theme WooCommerceIn any WooCommerce store, there are two major taxonomy options: categories and tags. Product tags are like product categories, but there is no hierarchy in tags. This means that there are no ‘subtags’. For example, if you are selling clothes and have many checked prints, you can tag for ‘checked’.

However, the “product_tag” taxonomy is something that we rarely need to use in our WooCommerce store. When you are not using it, you can easily remove it to keep the admin interface clean. If your WordPress Admin is cluttered, it decreases the usability, and things that do not work can confuse even technical users.

WooCommerce Storefront Theme Hide Tags

In this brief tutorial, I will share some code snippets that you can use to hide product tags. However, before doing anything from this tutorial, please go to Products > Tags and make sure that no tags are there.

Steps to Hide “All Products > Tags” Link from Admin Menu

Here is the link I am going to remove:

Product tags

Here are the steps that you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to add the function to hide the “All Products > Tags” link from the admin menu.
  3. Add the following code to the PHP file:
/**

 * Hide “All Products > Tags” Link from Admin Menu

 */

add_action( 'admin_menu', 'njengah_hide_product_tags_admin_menu', 9999 );

function njengah_hide_product_tags_admin_menu() {

            remove_submenu_page( 'edit.php?post_type=product', 'edit-tags.php?taxonomy=product_tag&post_type=product' );

}
  1. This is the outcome:Remove product tags

Steps to Remove Product Tags Metabox

If you go to any product’s edit page, you will find the “Product tags” meta box, similar to WordPress “Tags” meta box. You need to remove it because it allows you to choose from available tags and create new ones.product tags in product page

You can use CSS to hide it in the Screen Options, but it is not enough. Here are the steps that you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to add the function to remove the product tags meta box.
  3. Add the following code to the PHP file:
/**

* Remove Product Tags Metabox

*/

add_action( 'admin_menu', 'njengah_hide_product_tags_metabox' );

function njengah_hide_product_tags_metabox() {

remove_meta_box( 'tagsdiv-product_tag', 'product', 'side' );

}
  1. This is the outcome:remove product tags in product page

Steps to Remove Tags Column from All Products Page

This is the column that I am going to remove:products tags column

Here are the steps that you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to add the function to remove the tags column from all products page.
  3. Add the following code to the PHP file:
/**

* Remove Product Tags Metabox

*/

add_filter('manage_product_posts_columns', 'njengah_hide_product_tags_column', 999 );

function njengah_hide_product_tags_column( $product_columns ) {

unset( $product_columns['product_tag'] );

return $product_columns;

}
  1. This is the result:remove product tags column

Steps to Remove Product Tags Text Area from Quick Edit and Bulk Edit

Here is what we are going to change:property tags in quick edit

Here are the steps that you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to add the function to remove product tags text area from quick edit and bulk edit.
  3. Add the following code to the PHP file:
/**

* Remove Product Tags Text Area from Quick Edit and Bulk Edit

*/

add_filter( 'quick_edit_show_taxonomy', 'njengah_hide_product_tags_quick_edit', 10, 2 );

function njengah_hide_product_tags_quick_edit( $show, $taxonomy_name ) {

if ( 'product_tag' == $taxonomy_name )

$show = false;

return $show;

}
  1. This is the outcome:Remove product tags in the quick edit section

Conclusion

This brief tutorial has highlighted that WooCommerce has two major taxonomy options: categories and tags. Additionally, I have emphasized that no hierarchy in tags.

Moreover, I have shared how you can safely remove product tags in WooCommerce. I started by first removing the “All Products > Tags” link from the admin menu.

After that, I removed the product tag meta box. Removing it is critical because it allows you to choose from available tags and create new ones.

In the next section, I shared a PHP code snippet to remove the product tags column in the All Products page. Additionally, I have shared a PHP code snippet to remove the product tags text area from the Quick Edit and Bulk Edit.

Similar Articles

Comments are closed.