
By default WooCommerce shows Product Count Numbers just next to the category name in WooCommerce categories list.
Sometimes that’s not something you want to show to your customers. You may have too much products and the huge number looks ugly, or too small amount of products and you don’t want to reveal that.
Sometimes it just doesn’t look right, especially if you are using a free theme with simple design. Frankly speaking, even with the default WooCommerce theme Storefront, things doesn’t look good with it’s yellow marking.

To make things even worse, on a store with a large inventory (hundreds and thousands of items) the product count can easily slow down your loading speed.
Today we are going to show you how to hide the Product Count Numbers with a single line code snippet.
Preparation
Before we start, make sure you have a child-theme prepared for your WordPress theme. If you’re an Althemist themes user, you can download a free starter child-theme here. You should never customize the code in your parent theme as this will be wiped entirely every time when you update it.
Alternatively, you may use a plugin like Code Snippets to insert the code.
PHP Function to Hide The Product Count
Luckily, WooCommerce offers a lot of handy hooks and filters, so you only need a single line of code in order to disable the categories product count.
/* -------------------------------------------------- * Hide category product count in product archives * ------------------------------------------------- */ add_filter( 'woocommerce_subcategory_count_html', '__return_false' );
Where to Add the Code
The best place you can add the code would be at the bottom of your child-theme’s functions.php file.
Wrapping Up
Modifying basic WooCommerce features is pretty easy. However, If you are unfamiliar with code editing and resolving potential conflicts, we’d highly recommend to seek help from a qualified WordPress developer.
If you find this snippet helpful and used the custom WooCommerce function on your site, feel free to leave your thoughts in the comments area bellow.
This helped me a lot to get rid of that awful yellow color 😉
Thanks so much for the code, it works perfectly.
I was wondering if you know if I can choose which categories(4-5 categories) to be displayed as collection list on homepage?
TIA
Hi Lily s,
I am glad the code helped.
As for the collection list – not really sure what do you mean. Display categories OR display products from selected categories?
Hello erbesso,
We have just checked the function with the latest WooCommerce version (4.0) and it works absolutely fine. Make sure you placed the function in the right place (not inside another function).
Also, please note that we don’t speak Italian. All communication in this blog and the support system should be kept in English, so as many users as possible can benefit from the information.
Best regards,
Dimitar
Io ho provato ad inserirlo nella function.php del tema child Babystreet ma non ha funzionato. Ho provato anche nel tema genitore e non ha funzionato! Che fare?
Hi John,
Thanks for the feedback. We are glad it helped.
Regards,
Dimitar
Thank you.
Worked perfectly for me on Woocommerce – Shopper Theme.