Some shoppers do not search with words at all. They scan or paste a barcode number, copy an ISBN out of a reading list, or type the EAN printed on the box of the part they need to replace. Since WooCommerce 9.2, every store has a field for exactly that number: GTIN, UPC, EAN, or ISBN, sitting in the Inventory tab of the product editor.
Storing the number and searching it are two different things. The default WooCommerce search reads the product title, excerpt, and content, and never looks at that field. Paste a barcode into the search box and you get nothing back, even for a product you stock and have numbered correctly.
This guide covers where the field lives, how it differs from a SKU, and how to make it searchable with Advanced Woo Search PRO, including product variations that carry their own numbers. By the end you will have:
- Products findable by their barcode number. A search for a GTIN, UPC, EAN, or ISBN returns the product that carries it.
- Variations matched by their own numbers. A number belonging to one size or color returns that exact variation, not just its parent.
- The number shown on each result. Staff and shoppers can confirm at a glance that they found the right item.
- Control over what appears. Show parent products, variations, or both, and exclude the ones you do not want in search.

Searching this field is an Advanced Woo Search PRO feature, so the steps below need the PRO version. If you are not ready to upgrade, there is a code-only alternative further down.
What Is the GTIN, UPC, EAN, and ISBN Field in WooCommerce
All four names refer to the same thing: a globally unique number that identifies a product across every shop that sells it. GTIN is the umbrella term, UPC is the twelve-digit North American version, EAN is the thirteen-digit European one, and ISBN is the version used for books. WooCommerce gives them a single field, found under Product data → Inventory in the product editor.

Variable products can carry a number on each variation as well as on the parent, which matters later: a single t-shirt product might have a different EAN for every size.
GTIN vs SKU: What Is the Difference?
They look similar in the admin and they are often confused, but they belong to different people.
- SKU is yours. You invent it, you control its format, and it usually encodes something about how you stock the item. No other shop uses your SKU.
- GTIN belongs to the manufacturer. It is the same number in every shop that sells the product, which is why a customer can read it off the packaging and search for it anywhere.
That difference matters for search. Your own staff search by SKU, while customers arrive with a GTIN. Most stores want both, so it is worth reading this alongside our guide to WooCommerce search by SKU and turning both on at once.
Does WooCommerce Search by GTIN by Default?
No. The default WordPress search looks at three fields on each post: the title, the excerpt, and the content. Everything else, including custom fields like this one, sits outside the query entirely.
So a customer who pastes a thirteen-digit EAN gets an empty results page, and a member of staff checking whether an item is in the catalog concludes it is not. The number is right there in the database, and the search box cannot see it.

It is the same limitation that hides product categories, tags, and custom fields from search. Barcode numbers are the version that stings most, because a shopper searching one has a product in their hand and is ready to buy.
How to Enable GTIN, UPC, EAN, and ISBN Search
Advanced Woo Search builds its own index table of your catalog and searches that instead of relying on the default WordPress query. The barcode field can go into that index, which is what makes this possible.
To make your products searchable by their unique number:
-
Install and activate Advanced Woo Search PRO on your store.
-
Open the Index config page and tick GTIN, UPC, EAN, ISBN in the Data to index option.

The barcode field enabled under Data to index -
Run Reindex table and wait for it to finish.

Rebuilding the search index table -
Switch to the Search Config page and enable GTIN, UPC, EAN, ISBN in the Search in option. Indexing and searching are separate switches: the previous steps put the numbers into the table, and this one tells the search to look at them.

The barcode field enabled as a search source -
Set any other options you want while you are in the settings: other product fields to search in, what each result shows, result filters, search suggestions, and more.
-
Add the search form to your store if you have not already. The simplest way is the Seamless integration option, which swaps every default search form on your site for the plugin one. You can also place a form yourself with a shortcode or the search widget.

Seamless integration replaces the default search forms -
Test it from the front end with a real number from your catalog.

A barcode search returning the right product
From here on, numbers you add to new products are indexed automatically, with no further manual reindex.
Searching by Number Without the PRO Plugin
If you are not ready to upgrade, a code snippet gets you a rough version. WooCommerce stores the value in the _global_unique_id meta field, so the search query can be swapped for a meta lookup when someone types a number. Add it to your child theme's functions.php, a small custom plugin, or any code snippets plugin.
add_action( 'pre_get_posts', 'kk_search_products_by_gtin' );
function kk_search_products_by_gtin( $query ) {
if ( is_admin() || ! $query->is_main_query() || ! $query->is_search() ) {
return;
}
$number = trim( $query->get( 's' ) );
if ( $number === '' || ! ctype_digit( $number ) ) {
return;
}
$query->set( 'post_type', 'product' );
$query->set( 's', '' );
$query->set( 'meta_query', array(
array(
'key' => '_global_unique_id',
'value' => $number,
'compare' => '=',
),
) );
}
Be clear about what this does and does not do:
- Whole numbers only. It fires when the query is all digits, so an ISBN with an X check digit or a number typed with spaces slips past it.
- Parents only. Variations store their numbers on the variation itself, which this query does not reach. For most barcode catalogs that is the majority of the numbers, and the next section covers how PRO handles them.
- Exact matches only. No partial numbers, no relevance ranking, and no combining a number with a word.
- No live results. There is no AJAX dropdown and no suggestions.
It is the same trade-off as the code route for SKU search. Code gets you a demo, an index gets you something people can use.
Advanced: Searching Variable Products and Variations by Number
With the basics working, this is what separates a rough barcode search from a precise one. A variable product is a shell: the thing that actually carries a barcode is usually the variation. One t-shirt product can hold a dozen EANs, one per size and color combination.

Advanced Woo Search PRO treats variations as searchable products in their own right. What that gives you:
- Choose what appears: parents, variations, or both. Show only the variable product for a clean one-row-per-product list, both levels when shoppers may want either, or only the variations when the number identifies one exact item.
- Control what gets searched inside variations. By default a variation inherits its parent's content, so one loose word in the parent description matches every size. You can narrow matching to what is genuinely the variation's own: its short description, attributes, SKU, or number.
- Match a variation by its own number. A GTIN belonging to "medium, navy" returns that variation rather than the parent and a guessing game.
- Fall back to the parent. With variable product search enabled, searching any number assigned to a child variation also brings back the parent product, so a number never returns nothing.
- Display variations in full. Each result carries its own attribute values, image, and price, and the add to cart button adds that variation rather than the parent. Clicking through lands on the product with its attributes already selected.
- Filter variations out. Search results filters can exclude variations by attribute, price, or stock status, which is how discontinued sizes stay out of search while remaining on the shop pages.
How to Enable Variation Search by Number
Two settings on two different pages, exactly like the main setup:
-
Open the Index config page and make sure Index variations is enabled. Without it, variation numbers never reach the index table.

The Index variations option -
If that option was off, run Reindex table so existing variations are picked up.
-
Switch to the Search Config page and set the Variable Products option to whichever of the three display modes you want.

Choosing how variable products and variations appear -
Test with a number that belongs to a single variation rather than the parent product.
If one number starts returning a dozen near-identical rows, that is the inheritance behavior described above rather than a bug: restrict what is searched inside variations to their own fields. Our guide to searching and displaying WooCommerce product variations goes deeper on all of this.
Going Further: Display and Fine-Tuning
Show the Number on Each Result
Open the Search Results settings and enable Show product GTIN, UPC, EAN, or ISBN. Every result that has a number then displays it alongside the title and price.

This is worth more than it looks in a catalog full of near-identical items. When a customer is matching a number on a box against a screen, seeing that number in the result is the confirmation that stops a wrong order. For more control over what each row shows, see our guide to customizing the WooCommerce search results page.
Filter Search Results by GTIN
Search results filters are rules you set for which products may appear at all, and the barcode field can drive them. That is useful for keeping a specific list of items out of search while leaving them on your shop pages, or for restricting results to an approved set of numbers.
To set one up:
-
Go to Search Results → Filters in the plugin settings.
-
Click Filter products search results.
-
Choose the GTIN, UPC, EAN, ISBN field as the filter type and enter the numbers the rule applies to. Use the not in list condition to exclude those items from search results instead of restricting results to them.

A search results filter rule built on the barcode field -
Add any other filters you need on the same screen, such as price, category, stock status, or attributes.
The mechanism is the same one covered in our guides to filtering products by attribute and building filters from ACF fields, with the barcode field as the source.
Weight the Number Against Your Other Search Fields
Every field you enable under Search in competes for relevance: titles, descriptions, excerpts, SKUs, categories, tags, attributes, and the barcode number among them. Each carries its own weight, and the balance between them decides what ranks first. Open Search Config → Search in, find the GTIN, UPC, EAN, ISBN field, click the gear icon next to it and change the Weight value, comparing it against the weights on the fields you care about most.

An exact number match is about as unambiguous as search gets, so it usually deserves a weight above your text fields. Nobody types thirteen digits by accident.
Troubleshooting GTIN Search Issues
Most problems come down to one of these:
- Nothing is returned at all. Check both switches. The field has to be ticked under Data to index and enabled under Search in, with a reindex after the first of those changes.
- Parent products match but variations do not. Variations only appear as results when the plugin is set to display them. Check the variable product display option covered above.
- A number is split into pieces. Long strings that mix digits and letters can be broken up by the word and digit separation settings. Check them before assuming the number is missing from the index.
- One number returns a dozen rows. Variations are inheriting their parent's content. Restrict what is searched inside variations to their own fields.
FAQs
Does WooCommerce have a built-in GTIN field?
Yes. Since WooCommerce 9.2 there is a single GTIN, UPC, EAN, or ISBN field on every product, under Product data → Inventory. Variable products can carry a separate value on each variation.
What is the difference between a GTIN and a SKU?
A SKU is your own internal code, unique to your shop. A GTIN is assigned by the manufacturer and is the same everywhere the product is sold, which is why customers can search it. Most stores want both searchable, so pair this with SKU search.
Can I search by GTIN with the free version of Advanced Woo Search?
No. Indexing and searching this field is a PRO feature. The free version still improves your store search in other ways, including synonyms and search term highlighting.
Can shoppers find a specific variation by its own number?
Yes, with PRO. Variations are searched by the number stored on the variation itself, and can be returned as results in their own right, with their attributes, image, and add to cart button. Set the plugin to display variations for this to work.
Will a partial number match?
That depends on the Exact match option on the Search Config page. While it is enabled, only the whole number matches. Turn it off if you want partial numbers to return results, which helps when someone is reading digits off a damaged label. Full numbers are the normal case either way, since shoppers usually paste or scan them rather than typing fragments.
Can I order my search results by GTIN number?
Yes, with a code snippet. Results are ranked by relevance first, and you can then apply a second ordering rule to the products that made the cut using the aws_search_results_products_ids filter. Worth knowing that it reorders the results relevance has already selected, rather than sorting your whole catalog. The ordering search results documentation has working examples you can adapt.
Does barcode search slow down a large catalog?
No. The numbers live in the same index table as the rest of your searchable content, so searching them costs no more than searching titles. Only the initial reindex takes time, and it runs once.
Conclusion
A barcode is the least ambiguous thing a shopper can hand your search box. They are not guessing at wording or hoping your product titles match their vocabulary: they have the exact identifier in front of them. WooCommerce stores it and its own search ignores it.
Two settings and a reindex fix that, and setting variations to appear as their own results is what makes it precise. See the full Advanced Woo Search PRO feature list and pricing, or the GTIN, UPC, EAN, or ISBN search documentation for the full option reference.