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

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

  1. Leading zeros stripped by a spreadsheet. Open a UPC like 036000291452 in Excel and it becomes 36000291452: eleven digits, invalid. Format the column as text before importing.
  2. The SKU in the GTIN field. Your internal SKU (MUG-BLK-350) isn't a GTIN. It fails the digit and length rules immediately.
  3. One GTIN on every variation. Copying the parent's barcode to all sizes tells agents they're identical products.
  4. 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.
  5. 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:

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:

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:

  1. 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.
  2. Edit product by product. Fine for twenty products; painful for two thousand, especially with variations.
  3. 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.

Is your WooCommerce store readable by AI shopping agents?

The free LeyMish AI Shopping Readiness plugin gives you a 0–100 score and a fix list, and runs entirely on your site.

Download the free plugin See Pro