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 afterward 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 our 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. A web host sometimes offers 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.
Disable Search Result Counts from WooCommerce the Easy Way
We have put together a plugin that gives you the ability to disable WooCommerce search result counts from the pages of your store. Our plugin has one significant advantage over the code snippet we provided you earlier. The plugin lets you decide to remove the search result counts from either the top, bottom, or both positions that they are displayed in.
Purchasing and installing our plugin is simple and quick. There is no code to write and you don’t need to make your own child theme. All you have to do is upload our plugin after you buy it. There’s no need to worry if you have no plugin uploading experience. We will send you an email with instructions on the uploading and activating process. The whole thing will only take you a minute.
After installation, you’ll have a Remove Features tab in your WooCommerce settings screen. This is where you can control where you want the result counts removed.
It’s really that easy. The plugin offers more flexibility than our code example and you don’t have to do anything technical or time-consuming. Click a checkbox or two, save the changes, and you are done.
Your plugin purchase comes with:
- 90 days of support. Get help with your plugin up to three months after purchase.
- No license keys or yearly subscriptions. Pay $14 once.
- Unlimited installations. Install the plugin on as many sites as you want.
We offer a 14-day money-back guarantee. Get a full refund if you are unhappy with our plugin or if it doesn’t meet your expectations.