Remove Product Count from Categories on WooCommerce

If you are familiar with WooCommerce plugin, then you should have known by now that by default Product categories or subcategories displays the product count. This may or may not be a good feature depending on the site owner's taste or preferences. However, on one of my recent project the site owner wanted me to remove the product count.

Removing the Product Count

Product count can easily be removed from your theme by using the following snippet.

function remove_products_count() {

All you need to do is to copy this snippet and paste in on your theme's functions.php page. Update the page and you are good to go.

Get Creative

Just in case if you want to get creative and to do little extra with the snippet mentioned above, you can do that as well. Here is an example of such idea that I already implemented on one of my client's site. You can tweak this snippet as well and get creative with your ideas.

Remove Product Category CountRemoving Category Product Count in WooCommerce.

All I did here is simply returned a different variable instead of product count to fill up the extra space. Please remember that this text will show up within the product category or subcategory title (within <h3></h3> tag). So, it would be wise to wrap up your custom content with an element for better customization (with CSS) options.

function return_shop_now_text() {
   $shopnow = '<span class="shop-now">Shop Now &rarr;</span>';
   return $shopnow;}

Simply copy and paste this snippet on your current theme's functions.php page just like before and you are ready to roll. Feel free to drop a line if you have any question on this regard.


Commenting is disabled.