How to Remove the WooCommerce Search Result Count
Showing the number of results for a website search is a common practice these days. It is meant to give users, at a glance, an idea of just how broad (or specific) their search term was.
WooCommerce shows the result count at the top and bottom of every search that takes place on your store as well as individual category pages by default.
The search result count can often be an unnecessary detail just like the sorting dropdown. If your store has a limited number of products you might find yourself looking for a solution to remove the count entirely from your WooCommerce theme.
How to Hide the Search Result Count in WooCommerce with Code
You can remove the WooCommerce search result count from your online store’s theme can be done with some code changes. Here is an overview of the steps you should take to do this safely and properly without breaking your site.
ALERT! The first thing you should do is backup your current WordPress theme. Please do the following steps on your own computer first and not directly on the server. You can upload your changes to the server afterwards with any basic FTP program.
Build a Child Theme
Any WordPress theme change should be done through a child theme. A child theme allows you to modify your site’s theme safely. With a child theme, any updates your main theme receives won’t replace the changes and modifications in the child theme. There are a lot of tutorials online about how you can do this on your own. Make sure you’ve correctly created your child theme before going any further.
Add the Code to the Child Theme
You’re going to want to make a file called functions.php inside of your child theme directory. Add the following two lines of code to that file:
remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20); remove_action('woocommerce_after_shop_loop', 'woocommerce_result_count', 20);
This code makes sure to remove the search result count before and after the main content of your site.
Upload the Child Theme
You’re almost ready. The next part is to upload your child theme to your WordPress site and activate it. You can use any common FTP program on the market to connect to your web host and upload the theme. It’s possible you’ll need to hire a freelancer to handle this for you. Or you can reach out to your host’s support team for assistance.
Is this getting to be too technical for you? You might prefer to handle this all with a much simpler solution. You can avoid building a child theme, dealing with code, and even transferring files to a server. Jump ahead to learn how our Remove WooCommerce Features plugin can help.
Activate the Child Theme
If the upload process went correctly you should see your new child theme inside of the WordPress admin. Find the Appearance option in the menu and go there. Your child theme should show up among the list of other themes installed on your site. If you don’t see it double-check the upload was done correctly.
Activate the theme and, assuming the following steps went well, the search result counts should be removed from your site. If they are still there or the site has gone down with errors start from the beginning to see what went wrong.
When things are really bad, and the entire site is inaccessible, it might be time to call in a professional to help you out. Web host’s sometimes offer very limited WordPress technical support as well.
Finally, if you did all of the steps correctly, you can consider yourself more advanced than 99% of most WooCommerce users. Of course, there is an easier way to disable search result counts and you won’t have to write a single line of code to do it.
How to Disable Search Result Counts from WooCommerce without Code
There’s an easier way to remove the search result count from your entire WooCommerce store. There’s no file editing, code writing, or find a WooCommerce developer involved.
You will need to purchase a copy of Remove WooCommerce Features and then install and activate the plugin on your site. From there you can remove the search result count from your theme in three very simple steps.
Go to the WooCommerce section of your WordPress installation’s admin menu and click the link that says Remove Features.
Find the setting for Search Result Count and click the checkbox so that it’s marked like so:
Press the button.
Now you’re all set. Changes you make with Remove WooCommerce Features take place immediately after your settings are saved.
You can go to any search or category on your store and now see that the search result count has disappeared.
The Remove WooCommerce Features plugin doesn’t care about what theme you are using, or if it has been recently updated, so your setting is always preserved. You’ll never have to edit your theme’s files or pay someone else to do so for you once you have Remove WooCommerce Features installed on your store.
In addition to dealing with search result counts, our plugin will help you remove a bunch of other common WooCommerce features that sometimes get in the way more than they help.