Do you want to know how to hide category from search in WooCommerce?
By hiding certain categories, you can avoid cluttering search results, making it easier to navigate your online store.
In this article, we’ll show you the easiest way to exclude specific WooCommerce categories from search results on your site.
Why Hide Categories from Search in WooCommerce
There are lots of reasons why you might want to hide some WooCommerce product categories from the search results on your site.
By hiding categories from search in WooCommerce, you can:
- Make it easier to browse your store. The easier it’s for your customers to find a product they’re looking for, the more profit you’ll make.
- Manage products more effectively. It’s convenient to have a specific category where you can store products that you don’t want to appear in search results.
- Restrict access to limited offers. If you have a category with limited offers for certain customers, it’s better to exclude it from public search results.
Once we’ve figured that out, let’s take a look at how you can hide specific WooCommerce categories from being displayed.
How to Hide a WooCommerce Category from Search on Your Site
The easiest and fastest way to hide a WooCommerce category from search results on your site is to use a plugin like SearchWP.
This plugin gives you complete control over how search works on your WordPress site.
With it, you can select which categories you want to appear in search, prioritize specific search results, create custom search forms, and many more.
Over 30,000 eCommerce WordPress site owners already use it to give their customers more relevant search results and boost their sales.
SearchWP also improves your site search by helping you:
- Enable search by product attributes. Want your customers to search for products by their features, such as color, size, price, and others? With SearchWP, you can make WordPress consider product attributes when searching with just a few clicks.
- Add a search form to your shop page. Want to effortlessly increase your profit and make it easier for customers to browse your store? One of the best ways to do that is to add a search form to your shop page with SearchWP.
- Track on-site search activity. Wondering what your customers search for on your site? SearchWP gathers all the search data and gives you useful insights into your customers’ needs.
- Show search results in live mode. Want to show search results in your store in Amazon style? With SearchWP, you can add live autocomplete search to your store, making it faster for your customers to find what they’re looking for.
Now let’s take a look at how to exclude particular categories from your site’s search results using SearchWP.
Step 1: Install and Activate SearchWP
To get started, grab your copy of SearchWP here.
After that, go to your SearchWP account and navigate to the Downloads tab.
Then, press the Download SearchWP button to start downloading the plugin’s ZIP file to your computer.
Once the download begins, copy the SearchWP license key on the same tab. You’ll need it later to activate the plugin.
After you’ve finished downloading, the next step is to upload the plugin’s ZIP file to your site.
Need a refresher on how to do that? Check out the how to install a WordPress plugin step-by-step tutorial.
Once you’ve installed and activated the SearchWP plugin, the next step is to activate your license.
To do so, go to your WordPress dashboard and click the SearchWP button at the top panel.
Then, navigate to the License tab.
After that, put your SearchWP license key into the License field and click Activate.
That’s it. You’ve successfully activated your copy of SearchWP.
The next step is to install the WooCommerce Integration extension.
Step 2: Install and Activate the WooCommerce Integration Extension
This extension ensures seamless integration of WooCommerce and SearchWP, allowing you to get full control over search in your store.
You can grab it at the WooCommerce Integration extension download page.
After you’ve navigated to the page, press the Download Extension button and save it to your computer.
When you finish downloading, install and activate the extension the same way as SearchWP.
Once you’ve installed and activated the WooCommerce Integration extension, the next step is to customize your search engine.
Step 3: Customize Your Search Engine
To get started, navigate to SearchWP » Settings in your WordPress dashboard.
After that, you’ll get to the Engines tab. Here you can find all the search engines you currently have on your site.
By setting up a search engine, you can specify the way WordPress should carry out searches on your site.
For instance, you can add or remove search sources, limit search to certain types of content, adjust the weight of relevance attributes and many more.
As you can see, currently, there is only one search engine called Default. By editing its settings, you can customize how the search works across your site.
Right now it has only 3 search sources: posts, pages, and media.
To hide a specific WooCommerce category from search, we first need to add WooCommerce products as a search source.
To do so, press the Sources & Settings button.
Then, tick the checkbox next to the Products search source and press Done.
After that, there will appear a new Products search source. It means that WordPress now considers WooCommerce products when searching.
The next step is to add a rule that will exclude certain WooCommerce categories from search results.
To do so, press the Edit rules button within the Products section.
Here you can find the rules that apply to the Products search source.
There are no rules by default, so let’s add the first one. To do that, click Add Rule.
Since we want to exclude WooCommerce categories from search, first, choose the Exclude entries if: option.
Here is how it looks on our test site:
Once done, choose the Product categories taxonomy from the drop-down menu.
After that, enter the name of a WooCommerce category you’d like to exclude from the search to the very right field.
For example, we’ll exclude the Hats category from search.
Click Done to save your changes when you’re finished adding categories you want to exclude.
Then, press the Save Engines button to apply all the edits you made.
That’s it. You’ve successfully excluded a WooCommerce category for search results on your eCommerce website.
The final step is to test your new search.
Step 4: Test Your New Search
To do that, click the Visit Site button under the name of your site at the top left of your WordPress dashboard.
For the purposes of this tutorial, we excluded the WooCommerce Hats category from the search results on our test site.
To check if the exclusion rules have been applied correctly, we’ll search for the Green hat product, which is placed in the Hats category.
As you can see, no results were found. It means that we’ve successfully excluded the Hats category from the search results.
In this article, you learned how to hide a category from search in WooCommerce.
If you’re ready to get full control over the search on your site and easily exclude any categories with a few clicks, you can grab your copy of SearchWP here.
Would you like to add a smart search to your WooCommerce site? Check out the how to make a smart WooCommerce product search tutorial.
Do you want to customize your WooCommerce product search further? Follow the how to customize your WooCommerce product search step-by-step guide.