SearchWP Blog

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

How to search by WooCommerce product attributes

Did you know that the default WordPress search doesn’t allow your customers to search product attributes?

WordPress’s built-in search treats your WooCommerce store like a blog, looking only at post titles and content. So, if you have product details like color, size, brand, material, and more, then WordPress will ignore these details.

But with the right plugin, like SearchWP, you can include product details and enhance the search process of your eCommerce store.

In this article, we’ll show you how to make your WordPress site consider product attributes when performing a search.

Why Search By WooCommerce Product Attributes

To begin with, let’s clarify what product attributes are. Product attributes are any additional information you specify about your product.

It might be its color, size, weight, price, or anything else. Making this info searchable is crucial, as it helps customers to find products they’re looking for faster.

For example, let’s say you’re the owner of an online clothing store. Typically, the names of products in a clothing store contain only its type and brand, such as Adidas Full-Zip hoodie.

But what if a customer’s looking for a hoodie in a particular color?

You could’ve specified the color in the product attributes, but WordPress doesn’t consider this data when performing a search.

specify the product's color

So, your customers have no choice but to manually browse your store to find the desired product.

It’s tedious and boring, so it’s much easier for them to leave your site and make a purchase somewhere else.

That’s why it’s so important to make the product attributes in your WooCommerce store searchable if you want to succeed online.

Additionally, customers who have had a positive user experience on your site are more likely to return once again.

Building a loyal customer base is essential, as it allows you to maintain a stable flow of orders.

Now that we know why to make WordPress consider product attributes while searching, let’s see how you can do that.

How to Make WooCommerce Product Attributes Searchable

The easiest way to make WooCommerce product attributes searchable on your site is to use a plugin like SearchWP.

SearchWP

It is the best WooCommerce search plugin that brings tons of useful features. Plus, it has seamless WooCommerce integration.

With SearchWP, you can hide or prioritize specific products in search results, add a search form to your shop page, and much more.

Over 50,000 WordPress site owners already use it to give their visitors more relevant search results.

In addition to making WordPress consider product attributes, you can also use SearchWP to:

  • Track searches on your site: Would you like to find out what customers were searching for in your store? SearchWP collects data about search activity on your site so that you can get useful information on your customers’ needs.
  • Enable fuzzy search feature: Want to improve your customers’ search experience even further? Turn on the partial match feature in SearchWP settings so that your visitors can find the right product even if they make a typo in its name.
  • Make PDF files searchable: Do you upload any PDFs to your site, such as user manuals or product installation guides? With SearchWP, you can make the text in them searchable so that your visitors can find them more easily.
  • Restrict search to products only: Want to exclude unnecessary pages such as “About us” and so on from search results on your site? With SearchWP, you can do that in a few clicks so that nothing distracts your customers from shopping.

Now let’s take a look at how you can add a search by WooCommerce product attributes to your site using SearchWP.

Step 1: Install and Activate the SearchWP Plugin

The first step is to grab your copy of the SearchWP plugin by visiting the website and signing up for a new account.

Next, you can log into your SearchWP account and navigate to the Downloads tab.

Download SearchWP plugin from account area

Once there, click Download SearchWP to begin downloading the plugin’s ZIP file to your computer.

After downloading, you can also copy your license key in the same tab. You’ll need to activate the plugin further.

The next step is to upload the SearchWP ZIP file to your site. If you need help with this, then check out this guide on how to install a WordPress plugin.

Upon activation, you will see the setup wizard. Simply click the ‘Start Onboarding Wizard’ button to configure the plugin.

Onboarding wizard SearchWP

After you’ve set up SearchWP, the next step is to install the WooCommerce Integration extension.

Step 2: Install and Activate the WooCommerce Integration Extension

This extension ensures the seamless integration of SearchWP with WooCommerce and helps customers to find different products on your site with ease.

First, you will need to go to SearchWP » Extensions from the WordPress dashboard. Then head to WooCommerce Integration and click the Install button.

Install WooCommerce extension

Now, you’re ready to start customizing your search engine to make it consider WooCommerce product attributes.

Step 3: Customize Your Search Engine

SearchWP allows you to create an unlimited number of search engines and link them to specific search forms. With this feature, you can add separate, fully customized search forms to any place on your site.

Besides that, you can also edit the default search engines settings to customize how the search works across your entire WooCommerce store. For example, you can add new search sources, exclude certain content from search results, and more.

To get started, navigate to SearchWP » Algorithm page from your WordPress dashboard.

Here you’ll find the list of search engines created by SearchWP. By default, there is only the Default search engine, which is associated with every existing search form on your site.

For this tutorial, we want to allow visitors to search for WooCommerce products by the attributes using any search form on our site. That’s why we’ll customize the Default search engine.

The first step is to add WooCommerce products as a search source. To do so, simply press the Sources & Settings button.

Edit or add new search engines in WordPress

Next, a new window will open where you’ll see different sources that the default engine will use.

Go ahead and tick the checkbox next to the Products search source to make it active.

Select products as sources

When you’re finished, press Done to save the changes.

The next step is to make the product attributes searchable.

To get started, scroll down to the Products section and press the Add/Remove Attributes button.

Add and remove attributes of products

Next, you will see a new window popup. Here, you can add attributes stored as custom fields or taxonomies (categories and tags).

First, click on the ‘Custom Fields’ field and choose the Any Meta Key option.

Choose product any meta option

This will automatically make all the custom fields on your site searchable so that you don’t have to enter the name of each of them manually.

Since WooCommerce stores product attributes exactly as custom fields, by adding this shortcut, you’ll make them searchable too.

Besides that, you can also include product categories, tags, type, shipping classes, and more in the search process.

Select product category as attribute

When you’re finished, go ahead and press Done.

Then scroll back to the top and click Save to apply all the changes you’ve made to the Default search engine.

Save engine settings

That’s it. Now, your customers can search for products by their attributes.

The final step is to test your new search engine.

Step 4: Test Your New Search by Product Attributes

To get started, simply visit your site and try entering a product attribute in the search form.

For the purposes of this tutorial, we’ve added the Men’s Casual Pullover Hoodie product, which has the black color as an attribute. Let’s see if we can find this product by searching for black.

click Find Results

As you can see, we found the product, even though it doesn’t have the word black in its title or description.

It means that our test site now considers WooCommerce product attributes when performing a search.

we found the product by its attributes

Bonus: Search in Category in WooCommerce

Offering customers the ability to search for products exclusively within a specific category on your WooCommerce store can significantly refine their shopping experience.

When a user is already browsing a particular category, a site-wide search can introduce irrelevant results, causing frustration and potentially leading them away from their intended purchase.

By providing a category-specific search option, you help them quickly narrow down their choices and find exactly what they’re looking for within that focused area of your inventory.

With SearchWP, you can create custom rules and limit the search to specific WooCommerce categories.

Select your category

The best part is that SearchWP lets you create unlimited search engines, which can be linked to different search forms. This allows you to create separate forms for your online store.

To learn more, please see our guide on how to search in category in WooCommerce.

We hope this article helped you learn how to search by WooCommerce product attributes. You may also want to see our guide on how to fix WooCommerce product search not working and how to make a smart WooCommerce product search.

If you’re ready to enable search by WooCommerce product attributes on your site, you can grab your copy of SearchWP here.

author avatar
Aazim Akhtar

Create a Better WordPress Search Experience Today

Never lose visitors to unhelpful search results again. SearchWP makes creating your own smart WordPress search fast and easy.

Get SearchWP Now
Multiple Search Engines Icon