Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Remove the Product Count for Subcategories on WooCommerce Category Pages?

WooCommerce, by default, shows the product count of the subcategories on category pages. This can clutter the page, especially if there are many subcategories. In this guide, we will show how to remove the product count of subcategories, thereby improving the user experience by reducing distractions.
The image below represents the default behavior of showing the product count of subcategories before the code was implemented.

Remove the Product Count on Woocommerce Categories


Solution: Remove the Product Count for Subcategories

The code will remove the product count of subcategories and thus makes the categories page look cleaner.

add_filter( 'woocommerce_subcategory_count_html', '__return_null' );

Output

After implementing the code, the product count for subcategories will no longer be visible on the category page.

How to Remove the Product Count for Subcategories on WooCommerce Category Pages? - Tyche Softwares

If you want to improve your category pages, there are other similar customizations you can try out. For example, you could add a special offer or a promotional message that shows up on all your category pages. By using a code snippet, you can add the category description text in WooCommerce to ensure this message is visible across every category, making it easier to share important offers with your customers.

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x