How to Remove Category from Product Page WooCommerce

Remove Category from Product Page WooCommerce WooCommerce by default adds product categories in the single products page. In this post, I will share a quick and easy way to remove category from product page in WooCommerce.

Some themes have the action removed but most free WooCommerce WordPress themes will have categories displayed on the product page. The product categories appear in the product page as shown in the image below:

Remove Category from Product Page Woocommerce Step by Step

These categories appear in the product page Meta section and they represent the categories associated with the single product page.

Just like I shared in the previous tutorialhow to remove related products in WooCommerce product page, you can also remove category from product page in three quick steps.

Remove Category from Product Page WooCommerce Step by Step

  1. Locate functions.php file in your theme files or the child theme
  2. Add the remove_action code snippet to functions.php of your theme
  3. Save the changes and refresh the page and the categories should be removed from the product page

#1) Open functions.php Theme File 

This is the ‘engine’ of your WordPress site and it is the file that is responsible for coordinating all the functions that run in your WordPress theme.

When editing this file, you should be very careful since you can easily crush your site; it is safe to begin by creating a backup copy. All WooCommerce themes have this file and you can locate it in the theme folder as shown below:

Remove Product Meta ‘Categories’ in a Product Page – WooCommerce

#2) Add Snippet to Remove Category from Product Page

When you locate and open this file, you should add the code snippet below:

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );

Save the changes and refresh the product page and the categories should be removed. This code removed the action hook that adds the single page Meta. To understand how action hooks, I recently wrote this action and filter guide.

Alternatively, you can use CSS styles to remove category from product page.

This code works using the display property and targets the class that displays the categories in the single product page. You can add this code to your WordPress styles.css or child theme styles file:

.product_meta .posted_in {display: none !important;}

Conclusion

To remove category from product page in WooCommerce works by removing the WordPress action hook that adds the Meta summary in the single product page.

To understand how this code works comprehensively, it is recommended you learn how action and filter hooks work, especially the adding and removing action hooks – add_action and remove_action

Similar Articles

  1. 100+ Tips, Tricks & Snippets Ultimate WooCommerce Hide Guide
  2. How to Hide Product Gallery In WooCommerce

Comments are closed.