How to Remove Result Count WooCommerce: A Step-by-Step Guide

Are you looking to remove the result count from your website? Whether you’re a developer or a website owner, knowing how to remove the result count can help streamline your user interface and improve overall user experience. In this guide, we will walk you through the steps to effectively remove result counts from various platforms and technologies.

Understanding the Importance of Result Count in WooCommerce

Before diving into the removal process, let’s briefly discuss why result counts appear in WooCommerce and their impact on user experience.

Removing the result count can make your website look cleaner and more professional. By learning how to remove result count, you can improve your website’s user interface and overall user experience.

Step-by-Step Guide to Remove Result Count in WooCommerce

Now, let’s get into the details of how to remove result count. Example of what we going to remove is on the screenshot below.

remove result count

I suppose the first method is here more for completeness, because it involves altering WooCommerce template files, which is always not recommended if it is possible to do the same with filter hooks. Why is not recommended? Because each time you update WooCommerce plugin, you have to check if there any changes in files you replaced.

Anyway, if you copy templates/loop/result-count.php from the WooCommerce plugin directory to your theme folder woocommerce/loop/result-count.php, you can change just anything inside the new one. So, this method is probably useful if you would like to completely change the displayed text.

And now we are slightly moving on to the next method, which is 100% effective and you should use it if possible.

So, once you insert the code below into your theme functions.php file, the result count will be automatically hidden from all the archive pages like the shop page, product categories and tags and the search page as well.

Benefits of Removing Result Count

When you remove result count, your website will have a cleaner look and may load faster. This can lead to a better user experience and potentially improve your SEO.

remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );

And one more thing –  if you’re using StoreFront theme, you have to use

remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 );

Sometimes this code may not work you, for example, when you’re using it inside a plugin. In that case wrap the code in after_setup_theme action hook.

add_action( 'after_setup_theme', function() {
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 );
} );

And also possible to hide it with CSS.

.woocommerce-result-count {
  display: none;
}

Conclusion

By following this guide, you can remove result count from your website easily. This will help you create a more streamlined and user-friendly interface. If you have any questions or need further assistance, feel free to reach out.

Explore Steps to Take When Your Site Is Hacked and Related Blogs on WordPress Hacked: Effective Steps to Restore and Protect Your Website