Would you like to know how to exclude product from search in WooCommerce?
It helps you to give your visitors more relevant search results and boost your sales.
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, 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, 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 disappointed customers are harmful to your business, it’s better to avoid such situations.
Now that we know why it might be handy to exclude specific products from search results, let’s look at how you can do that on your site.
How to Exclude a WooCommerce Product from Search Results on Your Site
The easiest way to exclude specific products from your site search results is to use a plugin like SearchWP.
That’s the most powerful WordPress 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 many more.
Plus, it’s fully compatible with WooCommerce. It means that you can start using the plugin right after installation without any extra steps.
More than 30,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, grab your copy of the SearchWP plugin here.
Once done, sign in 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.
After completing the download, copy the license key at the bottom left. 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 the how to install a WordPress plugin step-by-step tutorial.
Upon the plugin installation, go to your WordPress dashboard and press the SearchWP button at the top panel.
Then, navigate to the License tab.
Paste your plugin license key into the License field and click Activate.
After you activate your copy of SearchWP, the next step is to install a couple of extensions.
Step 2: Install and Activate the WooCommerce Integration Extension
The first extension we’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.
You can grab this extension at the WooCommerce Integration extension download page.
Once there, press the Download Extension button and save it to your computer.
Once you finish downloading, install and activate the extension the same way as SearchWP.
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 with just a few clicks.
You can grab it at the Exclude UI extension download page.
Once you get to the page, click the Download Extension button and download its ZIP file to your computer.
When you finish downloading, install and activate the extension the same way as SearchWP.
Once you’ve installed the extensions, you’re ready to start excluding products from search results.
Step 4: Exclude Products from Search
There are 2 ways to do that. Let’s take a look at each of them in order.
The First Way: 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, navigate to the Products tab in your WordPress dashboard.
Then, click on a product you want to hide from appearing in search results.
After you get to the product editor, tick the Exclude from search checkbox.
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.
By following this way, you can automatically exclude products by attributes, tags, or anything else.
The Second Way: Automatically Exclude Products by Specific Taxonomy
To get started, press the SearchWP button at the top panel of your WordPress dashboard.
After that, you’ll see the Engines tab. On this tab, you can manage the search engines created with SearchWP.
You can think of a search engine as a set of rules that WordPress 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 WordPress should search, what attributes to consider, and many more.
To exclude products by a certain attribute, tag, category, or anything else, we’ll need to add an appropriate rule.
But before that, we should add WooCommerce products as a search source to our search engine.
To get started, press the Sources & Settings button.
Then, tick the box next to the Products source and press Done.
Now your WordPress site will consider WooCommerce products while performing a search.
The next step is to add a rule specifying which products WordPress should hide from displaying in search results.
To do that, press the Edit Rules button under the Products section.
Then, click Add Rule to add the first rule.
The next step is to choose the Exclude entries if: option from the top-left drop-down 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, we’ll select the Product tags taxonomy from the drop-down menu and then enter Special deal into the field next to it.
Here is how it looks on our test site:
When you finish editing the rules, click Done to save them.
After that, press the Save Engines 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, press the Visit Site button under your site’s name at the top left of your WordPress dashboard.
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.
Plus, earlier in this guide, we excluded the Organic face scrub product from the search on our test site following the first way.
Let’s see if it appears in the search results.
As you can see, there are no results.
It means that we’ve successfully hidden this product from displaying in the search results on our site.
In this article, you learned how to exclude product from search in WooCommerce.
It’ll help you deliver the most relevant search results to your visitors and increase your profits.
If you’re ready to start easily exclude WooCommerce products from search on your site, you can grab your copy of SearchWP here.
Looking for a way to make search in your WooCommerce store even better? Check out the how to make a smart WooCommerce product search tutorial.
Want to let your customers search for products by their SKUs? Follow the how to search by SKU in WooCommerce step-by-step guide.