How to structure them
Define fields in Shopify admin under Settings → Custom data → Products. Each field gets a namespace and a key: use mm-google-shopping for fields that map straight to Merchant Center, custom or a brand namespace for the rest. Set types correctly — single-line text for strings, number_decimal for numerics, measurement for weights and dimensions — and enable Storefront API exposure so the theme can read the field.
Add validation rules at definition time. A GTIN field should validate as 12–14 digits; country_of_origin should validate against ISO 3166. Validation is what catches the bulk-edit mistakes that otherwise become silent schema bugs.
Wiring metafields into Product JSON-LD
A metafield's value has to reach the rendered PDP before any engine can consume it. Most themes ship a skeleton Product JSON-LD block in Liquid; the useful work is replacing hardcoded values with metafield references. An illustrative pattern — adapt to your theme:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "{{ product.title | escape }}",
"sku": "{{ product.selected_or_first_available_variant.sku }}",
"gtin13": "{{ product.metafields.custom.gtin }}",
"brand": { "@type": "Brand",
"name": "{{ product.metafields.custom.brand | default: shop.name }}" },
"description": "{{ product.description | strip_html | escape }}",
"image": "{{ product.featured_image | image_url: width: 1200 }}",
"material": "{{ product.metafields.custom.material }}",
"color": "{{ product.selected_or_first_available_variant.metafields.custom.color }}",
"countryOfOrigin": "{{ product.metafields.custom.country_of_origin }}",
"offers": { "@type": "Offer",
"url": "{{ shop.url }}{{ product.url }}",
"priceCurrency": "{{ cart.currency.iso_code }}",
"price": "{{ product.selected_or_first_available_variant.price | money_without_currency }}",
"availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}" }
}
</script>
Note the selected_or_first_available_variant calls for variant-level fields. That is how the JSON-LD reflects the variant the shopper — or the shopping agent — is actually looking at, which matters because engines often retrieve a PDP URL with a variant pre-selected in the query string. Complete, variant-accurate offers data is also the largest single input to the agent-readability score: a draft-cart agent cannot add a product whose price and availability it cannot parse.
Metafields feed llms.txt too
llms.txt is a plain-text file served at the site root that gives AI crawlers a curated summary — product names, key attributes, canonical URLs. Metafields are the natural source of those attributes: a populated brand metafield flows into every product line of the file without anyone editing 500 entries by hand. The free llms.txt generator reads Shopify metafields directly; the llms.txt for Shopify guide covers the file itself, and the glossary entry has the short version.
The fields most stores leave empty
From the research team's 2026 audits, the most commonly missing metafields on otherwise well-run catalogs: GTIN, material, country_of_origin, and variant-level color. GTIN is the most expensive miss — it is the field every other source uses to resolve your product. Material is second, because it is how buyers talk. Variant-level color bugs are the quickest fix and the most visible: a shopper filtering "navy" gets nothing when color lives at the product level with "Multiple" as its value.
Variant-level vs product-level
Variants deserve their own metafields for anything that genuinely differs between them — the medium and the large have different dimensions, weights, sometimes materials. Product-level metafields hold what does not change: brand, material family, care instructions, origin. Mixing the levels is where most Shopify catalogs accumulate silent schema bugs. Shopify's own metafield documentation covers the admin and API mechanics; the SEO dimension lives in the schema for AI search guide.
Where to start this week
Open Settings → Custom data → Products and list what is defined. Mark the core set — GTIN, brand, material, country_of_origin, color, pattern, gender, age_group — present or missing. Define the missing ones with correct types and validation. Populate your top ten revenue SKUs by hand, in buyer language. Wire the theme's JSON-LD. Verify with Google's Rich Results Test. That is a realistic one-week project for a solo developer, and it improves grounding on every engine at once. eCommerce Insights automates the audit half: it reads the catalog through the admin API and flags exactly which fields are missing on which SKUs, with the diff attached.
Key takeaways
- Metafields are where structured product facts live; they are the backbone of SKU-level AEO on Shopify.
- Core set: GTIN, brand, material, pattern, country_of_origin, color, gender, age_group. Category fields extend it.
- Define once with validation, populate at the right scope, wire into Product JSON-LD.
- Most 2026 catalogs leave GTIN, material, and variant-level color blank — the highest-return fills.
- The same metafields feed JSON-LD, llms.txt, and the agent-readability score. One source, three surfaces.