SearchWP

News

how to hide category from search in WooCommerce

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.

Let’s begin!

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.

SearchWP logo

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.

go to the Downloads tab

Then, press the Download SearchWP button to start downloading the plugin’s ZIP file to your computer.

press Download SearchWP

Once the download begins, copy the SearchWP license key on the same tab. You’ll need it later to activate the plugin.

copy the license key

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.

go over to the SearchWP settings

Then, navigate to the License tab.

navigate to the License tab

After that, put your SearchWP license key into the License field and click Activate.

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.

press the Download Extension button

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.

go over to the SearchWP settings

After that, you’ll get to the Engines tab. Here you can find all the search engines you currently have on your site.

the Default search engine

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.

the list of search sources

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.

press Sources and Settings

Then, tick the checkbox next to the Products search source and press Done.

tick the Products checkbox and press Done

After that, there will appear a new Products search source. It means that WordPress now considers WooCommerce products when searching.

the Products search source

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.

press Edit Rules

Here you can find the rules that apply to the Products search source.

rules of the Products search source

There are no rules by default, so let’s add the first one. To do that, click Add Rule.

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:

select Exclude entries

Once done, choose the Product categories taxonomy from the drop-down menu.

choose Product categories

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.

add a category you'd like to exclude

Click Done to save your changes when you’re finished adding categories you want to exclude.

click Done

Then, press the Save Engines button to apply all the edits you made.

press Save Engines

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.

click Visit Site

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.

search for a product

As you can see, no results were found. It means that we’ve successfully excluded the Hats category from the search results.

no results were found

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.

Want to make your search awesome right now?

More than 30,000 sites have chosen SearchWP!

You can utilize all of the content that’s gone unrecognized by native WordPress keyword search instantly with SearchWP.

Get SearchWP for just $99

  • Committed Support
    If you need help, support is fast, friendly, and here for you
  • Streamlined Setup
    Installation and setup that’s optimized for speed
  • Great Documentation
    Helpful, clear, and usable documentation is a priority

See what SearchWP customers have to say

  • “We really love SearchWP. It is properly programmed, does what you expect from it and it’s very flexible. The extensions are a great addition and we often make use of them. Thanks for the great job.”

  • “I had problems with indexing umlauts on a German-language website. SearchWP support found a solution in a very short time. He also quickly found the right solution for my other suggestions. I can highly recommend the plugin.”

  • “My website contains an archive of digitised historic journals – hundreds of PDFs. Using Search WP allowed me to build an advanced search, index all PDF content, and returning matching results in a highly customisable format. Top notch support too!”