SearchWP Blog

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

How to search SKU in WooCommerce

Are you wondering how to search by SKU in WooCommerce?

If you run a WooCommerce store, you likely know the importance of keeping your product search fast, accurate, and user-friendly. 

While the default WooCommerce search does a decent job, it doesn’t allow customers to search by SKU (Stock Keeping Unit). This can be a problem, especially if you deal with a large inventory where products are identified by SKUs.

In this article, we’ll show you how to customize the WordPress search to enable search by SKU for your WooCommerce store.

Why Enable Search By SKU In WooCommerce

The Stock Keeping Unit, popularly known as an SKU, is a unique product identifier that is the backbone of inventory management. 

They help store owners, warehouse teams, and customers quickly identify and locate products. However, when SKUs aren’t searchable, it creates friction for customers who prefer using these unique identifiers, especially in B2B stores or when dealing with repeat orders. For instance: 

Imagine a customer who bought a specific pair of headphones last year. They still have the SKU from their receipt and want to reorder the same product. 

If your store doesn’t support SKU searches, customers will have to sift through categories or filters, which can lead to frustration and possibly to abandoning their purchase.

Adding SKU search ensures:

  1. Shoppers search with what they already have on hand. A customer holding a printed catalog, an old invoice, or a part number from a supplier will type that number straight into your search bar. If your search doesn’t recognize it, they’ll assume you don’t carry the item.
  2. A failed search costs you the sale. Shoppers rarely retype a search a second or third time. Most just leave your site and buy from a competitor who makes the product easier to find.
  3. Support tickets pile up. We’ve worked with many site owners who get the same question over and over: “Do you carry this SKU?” Enabling SKU search lets shoppers answer that question themselves.
  4. Large catalogs need it the most. The bigger your product catalog, the more shoppers rely on exact identifiers, like SKUs, to cut through hundreds of similar-looking items.

So, let’s see how to configure search by SKU in WooCommerce for your online store.

How To Enable Search By SKU In WooCommerce

The easiest way anyone can enable search by SKU in WooCommerce is by using SearchWP.

It’s the most powerful search plugin for WordPress that replaces the default WooCommerce search with an advanced, customizable engine. 

SearchWP - Best WordPress search plugin

One of SearchWP’s standout features is the ability to index and search custom fields, including SKUs. You can make almost all content on your site searchable, set custom search rules, and track search activity to better understand customer preferences. 

SearchWP is used by over 50,000 businesses worldwide to optimize their search experience and improve sales. Here are a few features of SearchWP: 

  • Effortless WooCommerce integration: SearchWP works seamlessly with WooCommerce, enhancing search capabilities for product descriptions, images, and other key details.
  • Real-time search suggestions: You can display search results instantly as customers type, making it easier to find products and improve the overall shopping experience.
  • Tracking search activity: You can monitor search queries performed on your store to better understand customer behavior and preferences, allowing for more data-driven decisions.
  • Searchable documents and PDFs: You can extend the search functionality to include manuals, guides, and other files, helping customers locate valuable information effortlessly.
  • Exclude content from search results: SearchWP lets you filter out irrelevant content, ensuring that customers quickly find what they’re looking for by removing non-essential results from the search experience.

So let’s see step by step how to enable search by SKU in WordPress using SearchWP.

Step 1: Install & Activate SearchWP

To get started, you can get the SearchWP package that fits your needs, as different packages come with different features. 

From there, go to the Downloads tab in your account dashboard. Go ahead and click Download SearchWP to save the plugin’s ZIP file to your computer. Copy your license key while you’re there.

How To Search By SKU In WooCommerce: Install SearchWP Step 1

From the same page, copy your license key, as you will need it to activate the plugin later.

You can proceed to install and activate SearchWP just as any other WordPress plugin.

Once activated, you’ll see a welcome screen. To begin the onboarding process, click Start Onboarding Wizard. This will help you configure the basic settings.

How To Search By SKU In WooCommerce: Install SearchWP Step 3

That’s it. You have successfully configured SearchWP. Now, we can proceed to the next step!

Step 2: Install & Activate WooCommerce Integration

In order to enable search by SKU in WooCommerce, we first need to make all WooCommerce products searchable. You can do that by installing and activating the WooCommerce integration of SearchWP. 

Do note that SKU search on your shop’s frontend needs the WooCommerce Integration extension, which is available on the Pro plan and up.

From your WordPress dashboard, go to SearchWP » Extensions. Then, find WooCommerce Integration in the list and click Install.

Install WooCommerce extension

This extension routes your store’s product search through SearchWP’s engine instead of WooCommerce’s basic keyword matching.

Finally, to enable search by SKU in WooCommerce, we need to configure the search engine. Let’s do that next.

Step 3: Configure The Search Engine To Enable Search By SKU

Now it’s time to tell SearchWP to actually search the SKU field. Head to SearchWP » Algorithm, where you’ll land on the Engines tab by default.

How To Search By SKU In WooCommerce: Configure SKU search in WooCommerce Step 1

From here, click “Sources & Settings” to configure the Default search engine. 

A panel will open where you can confirm whether Products is enabled as a source.

How To Search By SKU In WooCommerce: Configure SKU search in WooCommerce Step 2

Next, you need to make this search engine index the content of all WooCommerce products.

So, select Products from the list. Then, click the “Done” button after choosing sources that interest you.

How To Search By SKU In WooCommerce: Configure SKU search in WooCommerce Step 3

Now, a new section titled “Products” will appear on the search engine block.

The engine now indexes only the title, content, slug, author, and excerpt of products.

How To Search By SKU In WooCommerce: Configure SKU search in WooCommerce Step 4

To make it index SKUs, you’ll need to add them as an attribute to the search source.

Hence, click on the “Add/Remove Attributes” button under the Products section. 

How To Search By SKU In WooCommerce: Configure SKU search in WooCommerce Step 5

This will open up a modal popup where you can include custom fields and taxonomies.

Type SKU into the “Custom Fields” field and choose the “_sku” option from the drop-down menu.

How To Search By SKU In WooCommerce: Configure SKU search in WooCommerce Step 6

When you’re finished, click Done.

As you can see, our newly added _sku attribute currently has the lowest relevance weight.

How To Search By SKU In WooCommerce: Configure SKU search in WooCommerce Step 8

It means WordPress will give it the lowest priority in searches. Since we don’t want that to be the case, let’s set its weight to the maximum.

To do so, move the slider next to the _sku attribute all the way to the right.

How To Search By SKU In WooCommerce: Configure SKU search in WooCommerce Step 9

Once done, press the “Save” button at the top right to save the changes you made.

Depending on your specific case, SearchWP may ask you to update indexing. In that case, click the “Rebuild Index” button. 

How To Search By SKU In WooCommerce: Configure SKU search in WooCommerce Step 10

That’s it. Now, your site visitors can find products even when they search for them using the product SKU. Let’s test our new WordPress search to make sure everything works fine.

Step 4: Test Your New Search

It’s time to test whether everything works properly. To do that, visit your website’s front end and perform a search by SKU. 

For the purposes of this tutorial, we’ve added the “Blue Hoodie” product that has the “BH7564” SKU.

Let’s see if WordPress can find this product solely by SKU.

To do so, we’ll enter the “BH7564” query into the search field on our test site and press Search.

How To Search By SKU In WooCommerce: See search by SKU in action step 1

As you can see, we’ve successfully found the product by its SKU only.

It means that WordPress now indexes the SKU attribute and considers it when performing a search.

How To Search By SKU In WooCommerce: See search by SKU in action step 2

Bonus: Add Live Search To Your SKU Results

Once SKU search is working, you can take it a step further with the Live Search extension.

You’ll want to install it from SearchWP » Extensions. From there, shoppers see matching products, including SKU matches, drop into a dropdown as they type instead of waiting for a full page reload.

View live search settings

We cover the full setup in our guide on how to add AJAX search to WooCommerce. Check it out if you want live results on your shop’s search bar.

Frequently Asked Questions

1. Does WooCommerce support SKU search by default?

Not on its own. WooCommerce’s built-in search matches against the product title and description, so it doesn’t search the SKU field unless you add that capability with a plugin like SearchWP.

2. How do I add SKU search to my WooCommerce store?

Install SearchWP and the WooCommerce Integration extension (available on the Pro plan and up), then add the _sku custom field to your engine’s Products source with a high relevance weight. After rebuilding your index, shoppers can search by SKU right from your shop’s search bar.

3. Why isn’t SKU search working on my site?

The most common causes are the product source not being enabled on your engine or the index not finishing its rebuild after you added the SKU field. If you’ve checked both and it’s still not working, our guide on fixing WooCommerce search by SKU covers more troubleshooting steps, including issues in the admin product list.

4. Can shoppers search by a partial SKU?

Not by default, since SKU matching looks for the exact value stored in that custom field. SearchWP’s Partial Matches setting, found under SearchWP » Settings, acts as a fallback that kicks in only when an exact search returns no results, so it can help with a slightly mistyped SKU but isn’t a full substring search.

Next Up

Whether you manage a small boutique or a large-scale online shop, searching by SKU can significantly enhance the user experience and drive more sales. 

We hope you liked this tutorial and learned how to search by SKU in WooCommerce. You may also want to see our guides on making a smart WooCommerce product search and limiting search results to WooCommerce products only.

Get SearchWP now to add advanced search features to your online store!

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