Have you ever noticed customers finding products they shouldn’t see in your WooCommerce store search results?
Maybe you’re running a special promotion that’s only meant for certain customers, or you have seasonal items that shouldn’t appear during off-peak times.
Perhaps you’ve got products that are temporarily out of stock, or items that are only available through direct links for VIP customers.
We’ve seen this frustration countless times with store owners who want more control over their search functionality. The default WooCommerce search can be pretty basic, showing everything to everyone, and that’s not always what you want for your business strategy.
In this article, we’ll show you how you can exclude any product from search results on your site with a few clicks.
Why Exclude Products from Search in WooCommerce
There are a couple of common situations when hiding products from search results on your site might be useful.
For instance, let’s say you have special deals for a certain group of visitors, such as your newsletter subscribers. If anyone can find these deals using a search, then it doesn’t make much sense.
By hiding such products from search results, you can control their visibility and ensure that they are only available to the right users.
Another example is when some of your products are no longer in business or are out of stock, but you don’t want to remove them from your store.
If your customers come across such products in a search and decide to buy them, they’ll face disappointment.
Since frustrated customers are harmful to your business, it’s better to avoid such situations.
That said, let’s see how you can do that on your site.
Exclude a WooCommerce Product from Search Results
The easiest way to exclude specific products from your site search results is to use a plugin like SearchWP.
It is the most powerful WooCommerce search plugin that allows you to get full control over how search works in your store.
With SearchWP, you can create customized search forms, display search results in live mode, add or remove search sources, and more.
Plus, it’s fully compatible with WooCommerce and offers a dedicated extension. It means that you can start using the plugin right after installation without any extra steps.
Besides that, more than 50,000 eCommerce site owners already use SearchWP to give their visitors more relevant search results. It allows them to increase their revenue and build a loyal base of customers.
In addition to excluding products from search, you can also use SearchWP to:
- Enable search by product attributes: Would you like to let your customers search by product attributes like color, price, and so on? Using this plugin, you can enable this feature in just a few clicks.
- Prioritize products in search results: Want to put a specific product at the top of search results by a particular keyword? SearchWP allows you to do that with no coding needed.
- Limit search to certain product categories: Prefer to limit search in your store to some specific categories? Just add the appropriate rule to your search engine in SearchWP settings to make it come true.
- Track searches of your customers: Are you interested in what visitors were searching for in your online store? SearchWP automatically gathers data about all search activity on your site.
Now, let’s take a look at how you can exclude WooCommerce products from search using SearchWP.
Step 1: Install and Activate SearchWP
To get started, you will need to grab your copy of SearchWP by visiting the website and signing up for a new account.
Once done, simply sign in to your SearchWP account and navigate to the Downloads tab.
From here, you can press the Download SearchWP button to start downloading the plugin’s ZIP file to your computer.
After completing the download, you should also copy the license key at the bottom left, as you’ll need it further to activate the plugin.
The next step is to upload the downloaded SearchWP ZIP file to your site.
Not sure how to do that? Follow this guide on how to install a WordPress plugin step-by-step tutorial.
Upon activation, you will see the SearchWP welcome screen. Go ahead and click the ‘Start Onboarding Wizard’ button and follow the onscreen instructions.
After you’ve configured SearchWP, the next step is to install a couple of extensions.
Step 2: Install and Activate the WooCommerce Integration Extension
The first extension you’ll need to install is the WooCommerce Integration extension.
It ensures seamless integration of SearchWP and WooCommerce, so you can fully customize how search works in your store.
First, you will need to go to SearchWP » Extensions from the WordPress dashboard.
Then head to WooCommerce Integration and click the Install button.
Step 3: Install and Activate the Exclude UI Extension
The next step is to install the Exclude UI SearchWP extension. It allows you to exclude any post, page, or product from search results from the content editor.
You will need to go to SearchWP » Extensions from the WordPress dashboard and navigate to the ‘Exclude UI’ extension.
From here, simply click the Install button and the extension will automatically activate.
Once you’ve installed the extensions, you’re now ready to start excluding products from search results.
Step 4: Exclude Products from Search Results in WooCommerce
Now, there are 2 ways to hide products from WooCommerce search results.
First, you can use the Exclude UI option and manually exclude products from search. Second, you can set up rules in SearchWP and specify which products to remove from the search process.
Let’s take a look at each of these methods.
Method 1: Manually Mark Products You Want to Exclude from Search
The first way is to manually mark products that you want to exclude from search.
To get started, you’ll need to visit the SearchWP » Algorithm page from your WordPress dashboard.
Here, you can edit the default WordPress search or add a new engine for your site. Plus, you can control which sources and attributes to include in the search process.
Next, you can click the Sources & Settings button and see which sources the native search engine will include while searching.
Next, a new window will open with the default sources, which includes posts, pages, and media.
From here, you’ll need to ensure that Products is also selected as a source.
Once you’re finished, click the ‘Done’ button.
Next, you will need to navigate to the Products tab in your WordPress dashboard.
Here, you can find all the products on your WooCommerce store.
After that, go ahead and click on a product you want to hide from appearing in search results.
Next, you will see the product editor in WooCommerce.
Go ahead and tick the Exclude from SearchWP checkbox under the Publish metabox.
Once done, press the Update button to save the changes.
That’s it. This product will no longer appear in the search results on your site.
Now, let’s take a look at the second way of excluding products with SearchWP where you can automatically exclude products by attributes, tags, or anything else.
Method 2: Automatically Exclude Products by Specific Taxonomy
To get started, you will need to go to the SearchWP » Algorithm page from your WordPress dashboard and customize the search engine.
You can think of a search engine as a set of rules that SearchWP follows when performing a search. By adding or removing these rules, you can fully customize how search works on your site.
For example, you can specify where it should search, what attributes to consider, and many more.
To exclude products by a certain attribute, tag, category, or anything else, you’ll need to add an appropriate rule.
But before that, we should add WooCommerce products as a search source to our search engine. So, go ahead and press the Sources & Settings button.
A new window will open, where you’ll see the sources used by the search engine.
After that, you need to tick the box next to the Products source and press Done when you’re finished.
Now your WordPress site will consider WooCommerce products while performing a search.
The next step is to add a rule specifying which products you want to hide from displaying in search results.
To do that, you can scroll down to the Products section and press the Edit Rules button.
A new window will now open where you’ll need to add new rules. At first, there will be no rules.
You can go ahead and click Add Rule to add the first rule.
On the next screen, you can set the rule to exclude WooCommerce products.
First, you will need to choose the Exclude entries if: option from the top-left dropdown menu.
After that, click on the Taxonomy field and choose a particular taxonomy by which you want to exclude products.
Taxonomy is a common attribute of a group of products. It might be a product type, category, tag, or something else.
For example, let’s say that we want to automatically exclude from search all products with the Special deal tag.
To do that, you can select the Product tags taxonomy from the dropdown menu and then enter Special deal into the field next to it.
Here is how it looks on our test site:
You can also exclude products based on categories, color, size, shipping class, and more by setting up different rules.
When you finish editing the rules, click Done to save them.
After that, you can press the Save button at the top right to save all the changes you’ve made.
That’s it. Now all products with a Special deal tag will no longer appear in search results on your site.
The final step is to try out your new search.
Step 5: Test Your New Search
To do that, simply visit your website and head to the search form on your WooCommerce store.
For the purposes of this tutorial, we uploaded the Daily moisture lotion product to our store and added a Special deal tag to it.
Let’s try to search for it and see if it shows up in the search results or not.
As you can see, there are no results for the Daily moisture lotion.
It means that the rule we added to our search engine to exclude products with the Special deal tag from the search works correctly.
FAQs About Excluding Products from WooCommerce Search
Here are some common questions people have about excluding products from search in WooCommerce.
1. How do I hide specific products from WooCommerce search results?
You can hide specific products from search results using a plugin like SearchWP. After installing the plugin and the Exclude UI extension, you can simply check the ‘Exclude from SearchWP’ box in the product editor to remove it from search.
2. Can I automatically exclude products based on tags or categories?
Yes, with SearchWP you can set up rules to automatically exclude products from search based on taxonomies like product tags, categories, or even custom attributes. This is ideal for seasonal items, special deals, or limited-access products.
3. Will excluded products still appear in my store or category pages?
Yes, excluding products from search results only affects the internal search function. The products will still be visible on other parts of your store (like category pages or direct URLs) unless you take additional steps to hide them elsewhere.
4. Can I reverse the exclusion and make products searchable again?
Yes, you can easily make excluded products searchable again. Simply uncheck the “Exclude from SearchWP” option in the product editor or remove the exclusion rule from your SearchWP algorithm settings.
We hope this article helped you learn how to exclude product from search in WooCommerce. You may also want to see our guides on how to make a smart WooCommerce product search and how to search by SKU in WooCommerce.
If you’re ready to start easily exclude WooCommerce products from search on your site, you can grab your copy of SearchWP here.