2026-09-27
Missing GTINs: why AI shopping agents skip WooCommerce products
When a shopper asks an AI assistant for "the Stanley Quencher 40 oz in cream", the assistant has to work out that your listing, three other stores' listings and the manufacturer's page are all the same product. The most reliable way it does that is the GTIN: the number under the barcode. No GTIN, and your product is a guess. Guesses lose to listings that can be matched exactly.
This guide covers what GTINs are, why the AI shopping specs care, where WooCommerce keeps them, and how to find and fix the gaps.
What a GTIN is
GTIN (Global Trade Item Number) is the umbrella name for the product numbers issued through GS1:
| Name | Digits | Where you see it |
|---|---|---|
| GTIN-8 (EAN-8) | 8 | Small packaging |
| GTIN-12 (UPC-A) | 12 | North America |
| GTIN-13 (EAN-13, and ISBN-13 for books) | 13 | Most of the world |
| GTIN-14 | 14 | Cases and multi-packs |
The last digit is a check digit calculated from the others, so a mistyped GTIN can usually be caught without looking it up anywhere.
Why the AI shopping specs care
- OpenAI's product feed lists
gtinas a recommended field: "exactly 8, 12, 13, or 14 digits with valid check digit", keeping leading zeros. If there's no GTIN,mpn(manufacturer part number) is the fallback (Product Feed Spec). - Google Merchant Center goes further: if the manufacturer assigned a GTIN, you must provide it; if
there isn't one, you need brand and MPN; and
identifier_exists = nois only for products that truly have no identifiers (product data spec). Google's AI Mode and Gemini shopping draw on the same product data. - Structured data on your page (schema.org Product) has
gtin8,gtin12,gtin13,gtin14andmpnproperties. WooCommerce fills them from the product when the data exists.
In every case, identifiers are the difference between "this is the same product" and "this might be".
Where WooCommerce stores GTINs
Since WooCommerce 9.2, every product and every variation has a built-in field labelled "GTIN, UPC, EAN, or ISBN" (Product data → Inventory). Developers know it as the product's "global unique ID". Before that, stores used plugins, each with its own custom field, which is why older catalogs often have GTINs scattered across several fields or none at all.
Brand has had a home in core since WooCommerce 9.6 (Products → Brands). MPN still has no core field; stores keep it in a custom field or an attribute.
Variations need their own GTINs. A t-shirt in five sizes is five different trade items with five different barcodes. A GTIN on the parent product alone doesn't tell an agent which size it's looking at.
Checking a GTIN yourself
The check digit works like this: take every digit except the last, and starting from the right, multiply alternately by 3 and 1. Add the results, and the check digit is whatever brings the total up to the next multiple of ten.
For 4006381333931:
digits (without check): 4 0 0 6 3 8 1 3 3 3 9 3
weights from the right: 1 3 1 3 1 3 1 3 1 3 1 3
products: 4 0 0 18 3 24 1 9 3 9 9 9 → sum 89
next multiple of 10 is 90 → check digit 1 ✓
The same logic in PHP (this is the function our plugin uses):
function gtin_is_valid( $value ) {
$gtin = preg_replace( '/[\s\-]+/', '', (string) $value );
if ( ! preg_match( '/^(\d{8}|\d{12}|\d{13}|\d{14})$/', $gtin ) || preg_match( '/^0+$/', $gtin ) ) {
return false;
}
$digits = array_map( 'intval', str_split( $gtin ) );
$check = array_pop( $digits );
$sum = 0;
foreach ( array_reverse( $digits ) as $i => $d ) {
$sum += ( 0 === $i % 2 ) ? $d * 3 : $d;
}
return ( ( 10 - ( $sum % 10 ) ) % 10 ) === $check;
}
A valid check digit doesn't prove the GTIN belongs to your product, but an invalid one proves it doesn't belong to anything.
The mistakes that break GTINs
- Leading zeros stripped by a spreadsheet. Open a UPC like
036000291452in Excel and it becomes36000291452: eleven digits, invalid. Format the column as text before importing. - The SKU in the GTIN field. Your internal SKU (
MUG-BLK-350) isn't a GTIN. It fails the digit and length rules immediately. - One GTIN on every variation. Copying the parent's barcode to all sizes tells agents they're identical products.
- Made-up numbers. Some stores generate "GTINs" to pass feed validation. Google's spec asks for GTINs assigned by the manufacturer, and invalid or invented codes can get products disapproved, which is worse than leaving the field empty.
- Spaces and hyphens. Harmless if your tools strip them, but some feed tools don't. Store digits only.
Finding the right GTIN for a product
If you resell products, the GTIN already exists; you just need to collect it:
- The packaging. The number printed under the barcode is the GTIN. Scanning apps read it too.
- Your supplier or distributor. Their product data sheets, price lists or data feeds almost always include a UPC or EAN column. Ask for it in a spreadsheet; it's faster than typing.
- The manufacturer's site or B2B portal. Many brands publish GTINs in spec sheets for exactly this reason.
- GS1's lookup. GS1, the organisation that issues GTINs, runs a public lookup service ("Verified by GS1") that shows which company a GTIN is registered to. Use it to double-check a number you're unsure of.
If you make the products and sell them through other retailers or marketplaces, you may want real GTINs of your own. Those come from your country's GS1 member organisation. Be wary of sites selling very cheap barcodes: the numbers may be registered to a different company in GS1's records, so they won't match your brand when a platform checks.
What if a product has no GTIN?
Handmade goods, private-label products and custom items often have none, and that's fine. In that case:
- Set a brand (your own shop name counts for your own products), and
- give it an MPN: your own consistent part number works if it's the one you'd use to identify the product.
In a Google feed, identifier_exists = no is correct only when there genuinely is no GTIN, brand or MPN
from the manufacturer. Don't use it to silence a warning for products that do have barcodes.
Finding every gap in your catalog
Doing this by hand across hundreds of products isn't realistic. The free LeyMish AI Shopping Readiness plugin checks every published product, including each variation, for a valid GTIN (check digit included) or an MPN, plus brand, price, image, description and attributes. It gives a per-product completeness score and a CSV of every gap, so you can sort by what's missing and work through it.
Fixing them in bulk
Three ways, from free to fastest:
- WooCommerce's CSV importer (Products → Import) can update existing products by ID or SKU. Export your products, fill the GTIN column (as text), and import with "Update existing products" ticked.
- Edit product by product. Fine for twenty products; painful for two thousand, especially with variations.
- A bulk editor. Our Pro add-on adds one table for GTIN, brand and MPN across all products and variations. It checks each GTIN's check digit before saving and writes to WooCommerce's own GTIN field and Brands, so any feed or schema plugin that reads core fields picks the data up.
Whichever route you take, re-run the audit afterwards. Identifiers are the single biggest block of points in it, because they're the single biggest reason products get skipped.