Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Enable Search by Product SKU in WooCommerce

Your customers don’t always think about products the way you do.

While you might organize your inventory by categories and names, many shoppers have product codes saved in their notes, printed on old invoices, or recommended by colleagues.

When they can’t search by these familiar SKU codes, finding the right product becomes unnecessarily complicated.

SKU search is particularly valuable for certain types of customers. For example, wholesale buyers often work with product codes exclusively. Repeat customers remember the codes from their favorite items. And technical product buyers reference specific model numbers.

When your search function accommodates these shopping habits, you remove friction from the buying process.

In this tutorial, we’ll walk you through the easiest way to enable SKU product search in your WooCommerce store.

How to Enable Search by Product SKU in WooCommerce

Why Enable Search by Product SKU in WooCommerce?

To run a successful WooCommerce store, it’s important for your customers to easily find the products they wish to purchase. To make this simple, most eCommerce platforms use SKUs, or Stock Keeping Units, to uniquely identify each product.

If a customer knows the SKU for the product they wish to purchase, why not let them search for the SKU to instantly find the correct product in your store?

The problem is that WooCommerce SKUs are stored in custom fields, and these are not indexed or included in search results by default. As a result, searching for the SKU won’t help.

Let’s take a look at how to solve this problem by enabling users to search by SKU in WooCommerce using a product search plugin.

How to Enable Search by Product SKU in WooCommerce

The easiest way to enable search by product SKU in WooCommerce is by using SearchWP.

It is the best custom search plugin for WordPress and is used by over 30,000 websites. It lets you customize the search algorithm to include product SKU, add live Ajax search for real-time results, highlight search terms, add fuzzy search, and so much more.

We have extensively tested the plugin on our demo website and have found it to be the easiest and most powerful way to improve search results in WordPress. If you want to find out more about our experience, then take a look at our complete SearchWP review.

The first thing you need to do is install and activate the SearchWP plugin. You’ll need at least the Pro plan to access WooCommerce integration. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the SearchWP » Settings page and switch to the ‘Support’ tab to enter your license key. You can find it in your downloads area for your account on the SearchWP site.

Paste Your SearchWP License Key

Next, you need to install and activate the WooCommerce Integration extension for SearchWP.

This is found in the downloads area for your account on the SearchWP website, too. You should install it as you would install any other WordPress plugin.

Install the WooCommerce Integration Extension

Now you are ready to customize the SearchWP search engine to index your product SKUs.

Simply go to the SearchWP » Settings page and make sure you’re on the ‘Engines’ tab. Once there, you need to click the ‘Sources & Settings’ button.

Click on the 'Sources & Settings' Button

This will bring up a popup where you should make sure the checkbox next to ‘Products’ is checked. This will allow SearchWP to index your WooCommerce products.

Also, if you’d also like to include WooCommerce product reviews in your search results, then make sure you check the ‘Comments’ box, too. That’s because product reviews are actually stored as comments in WooCommerce.

Check the Products and Comments Boxes

Once you’ve done that, click on the ‘Done’ button to close the popup and get ready to add the SKU search.

Now you need to scroll down to the ‘Products’ section. Notice that by default, the plugin will only look at the product title, content (description), slug, and excerpt (short description).

Click the 'Add/Remove Attributes' Button in the Products Section

You can extend SearchWP’s reach to include SKUs by clicking on the ‘Add/Remove Attributes’ button. This will bring up a popup where you can include specific custom fields and taxonomies in searches.

You’ll need to type ’SKU’ under Custom Fields and choose the _sku option from the dropdown menu. This will add SKUs to WooCommerce search results pages.

Select _sku From the Custom Field Drop Down Menu

You can now click the ‘Done’ button.

Notice that there is now a new section labeled ‘Custom Fields’ with the _sku field underneath.

Slide the SKU Relevance Slider to the Right

To begin with, the relevance slider will be set all the way to the left, which means that SKU search results will be given the lowest priority in search results.

Since SKUs are an important way to find your products, you should move the _sku slider all the way to the right, as you can see above.

When you’re done, go ahead and click on the ‘Save Engines’ button at the top of the screen to save your settings.

Click the 'Save Engine' Button

SearchWP will then start rebuilding your search index in the background. It may take a few minutes to complete, but after that, you will be able to search your WooCommerce store by product SKU.

SearchWP will automatically use any search forms on your online store, so there is no need to take any additional steps if you have them on your site already.

However, if you need to add a search form, then see our step-by-step guide on how to create a custom WordPress search form. This will also teach you how to style the results page using custom CSS.

Now you can go to your WooCommerce store to try out the search feature.

In our demo store, the long sleeve tee has the SKU ‘woo-long-sleeve-tee.’ When we search for that SKU, the correct product is displayed.

Preview of Product SKU Search in WooCommerce

If you’d like to learn more about improving search on your online store, then be sure to take a look at our guide on how to make a smart WooCommerce product search.

Frequently Answered Questions

Here are some questions that are frequently asked by our readers about enabling product search by SKU in WooCommerce:

Do I need to write code to enable WooCommerce search by SKU?

Nope—no coding required if you’re using the right plugin.

While it’s possible to edit your theme’s functions file or add custom code, a beginner-friendly option like SearchWP lets you enable SKU search through a simple settings panel. Just check the box to include SKUs, rebuild your index, and you’re good to go.

Will enabling SKU search affect my store’s performance?

Enabling the SKU search won’t affect your store’s performance if you are using a well-optimized plugin like SearchWP.

SearchWP is designed to handle large catalogs and won’t slow down your site. It builds a separate index to power searches efficiently, so even if your store has thousands of products, your search will stay fast and accurate.

Can customers search using partial SKUs?

Yes, if you’re using SearchWP, you can enable the partial matches setting to allow customers to search using partial SKUs.

That means customers don’t need to type the full SKU to find a product—just part of it will do. This is super helpful if your SKUs are long or follow a specific pattern.

For step by step instructions, you can see our tutorial on how to add fuzzy search in WordPress.

What if I already use another search plugin?

If you’re using a different search plugin, then you can check whether it supports custom fields and WooCommerce integration.

Some plugins only search titles and content, which means they won’t pick up SKUs. If SKU search is important to your store, switching to SearchWP might be the easiest and most reliable way to get that functionality.

Expert Guides on Improving Search in WordPress & WooCommerce

We hope this tutorial helped you learn how to enable product search by SKU in WooCommerce. You may also want to see some other articles related to improving search in WordPress and WooCommerce:

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

Comments

  1. Congratulations, you have the opportunity to be the first commenter on this article.
    Have a question or suggestion? Please leave a comment to start the discussion.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.