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.
Key Takeaways:
- SKUs help customers quickly find specific products, especially in stores with a large inventory.
- WooCommerce’s default search doesn’t support SKU search; a drawback for large B2B stores.
- SearchWP makes it easy for anyone to add SKU search functionality to 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 abandoning their purchase.
Adding SKU search ensures:
- Faster product discovery for customers who know what they’re looking for.
- Improved user experience by offering more search flexibility.
- Reduced support inquiries from customers needing help finding products.
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.
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
Get the SearchWP package that fits your needs, as different packages come with different features. After purchasing, navigate to your Accounts page and download the plugin file.
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.
Alternatively, you can activate your copy of SearchWP directly by visiting SearchWP > Add License Key.
Paste the license key you copied earlier (in the previous step) into the designated field, then press “Verify Key” to complete the activation process.
Your licensing information will appear below when the key is verified.
That’s it. You have successfully configured SearchWP. Now, we can proceed to the next step!
Step 2: Install & Activate The WooCommerce Extension
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 extension of SearchWP.
Therefore, please navigate to SearchWP > Extensions and find WooCommerce Integration from the list. Then, click Install.
Wait a few moments, and you’ll see it successfully installed. From now on, SearchWP have access to all WooCommerce products on your site.
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 In WordPress
Now, we need to customize the SearchWP engine to make SKUs searchable. To do that visit SearchWP > Algorithm from the left sidebar of your WordPress dashboard.
From here, click “Sources & Settings” to configure the Default search engine.
You’ll see a modal pop-up with a list of sources to choose from. We need to make this search engine index the content of all WooCommerce products. Therefore, select Products from the list. Then, click the “Done” button after choosing sources that interest you.
Now, a new section titled “Products” will appear on the search engine block. The engine now indexes only the title, content, slug, and excerpt of products.
To make it index SKUs, we need to add them as an attribute to the search source. Hence, click on the “Add/Remove Attributes” button under the Products section.
This will open up a modal. Type SKU into the “Custom Fields” field and choose the “_sku” option from the drop-down menu.
When you’re finished, click Done.
As you can see, our newly added _sku attribute currently has the lowest relevance weight.
It means that WordPress will give it the lowest priority when searching. 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.
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.
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.
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.
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. We think you’d also like to know how to customize the WooCommerce search results page.
Get SearchWP now to add advanced search features to your online store!