Pendium
The Optimization Playbook

How to map Shopify material metafields to JSON-LD for AI shopping queries

Claude

Claude

·7 min read

When a shopper asks ChatGPT or Perplexity for a "100% organic cotton heavyweight crewneck," conversational AI engines retrieve structured product attributes rather than parsing marketing paragraphs. Pendium tracks brand visibility across seven major platforms—including ChatGPT, Claude, and Gemini—and our platform data shows that stores omitting fabric data from machine-readable code get skipped in material-specific searches. To make your apparel or home goods catalog eligible for these high-intent recommendations in 2026, you must map your custom Shopify material attributes directly to your JSON-LD Product schema.

What default Shopify theme schema leaves behind

Shopify powers millions of merchant storefronts, but its base themes do not prepare product catalogs for conversational commerce. The standard Shopify Dawn theme generates basic structured data, but it only populates title, description, featured image, and offer properties like price and availability.

Fabric composition, certifications, and technical garment specifications remain absent from the theme's core schema output. As documented by Naridon's Shopify schema guide, out-of-the-box themes drop attributes like GTIN, brand, material, and color from the JSON-LD script tag.

AI crawlers such as GPTBot, ClaudeBot, and PerplexityBot consume structured data as definitive fact. While an LLM can scan HTML body text, unstructured descriptions often mix styling notes, brand narrative, and care instructions into a single block of prose. If an engine cannot cleanly parse whether a jacket is 100% wool or a polyester blend from the structured graph, it prioritizes a competing merchant whose data schema explicitly verifies the fabric.

AttributeDefault Shopify Dawn SchemaAI-Ready JSON-LD Schema
Product Title & DescriptionSupported (name, description)Supported (name, description)
Price & In-Stock StatusSupported (offers)Supported (offers)
Material & Fabric CompositionMissingSupported (material)
Sizing & DimensionsMissingSupported (size, hasMeasurement)
Unique IdentifiersOften missing (gtin13, sku)Supported (gtin13, sku, mpn)

Leaving material specifications locked in descriptive paragraph text puts your catalog at a disadvantage. Fixing this requires pulling the attribute out of your body copy and structuring it directly in your Shopify admin.

Structure the material data in your Shopify admin first

Before you can output material data into your template, the underlying values must exist within Shopify's database. Avoid adding material details as tags or comma-separated lists in the product subtitle. Those workarounds cannot be typed or validated reliably.

Using native Shopify metafields establishes a rigid data model. This makes the data accessible to your theme code, external channels, and AI shopping crawlers alike.

Defining the namespace and key

Open your Shopify admin and head to Settings, select Custom data, and click on Products. Here you will define a standardized field definition that applies across your entire inventory.

Set the namespace and key to custom.material. While Shopify introduced standard taxonomy fields under the shopify. namespace, many third-party apps, feed managers, and custom scripts still reference the custom. namespace by default. Keeping your key simple and predictable avoids syntax issues in Liquid later.

Add a clear description for your merchandising team, such as "Primary fabric composition (e.g., 100% Merino Wool)." Set validation rules if your catalog uses specific, standardized material naming across product lines.

Selecting the correct data type

Choosing the right metafield type prevents parsing errors when your theme renders the structured data block. For material data, you have two practical choices:

  • Single-line text: Best if your products are described by a single phrase, such as "100% Linen" or "98% Cotton, 2% Elastane."
  • List of single-line text: Best if you want to track distinct components separately (for example, "Recycled Polyester" as item one and "Spandex" as item two).

Avoid rich text fields for this task. As detailed in learnshopify.dev's guide to displaying metafields, rich text fields store data with enclosed paragraph tags and HTML formatting. Rendering rich text inside a JSON-LD script block outputs escaped HTML markup, which corrupts the JSON syntax and causes crawlers to invalidate the entire schema tag.

Once the definition is active, populate the field on your key products. A technical schema update cannot surface values that do not exist in the database.

Map the metafield to your JSON-LD product block

With your metafield configured and populated, you need to expose it inside your storefront's code. This requires editing your theme's Liquid files to append the material property to the existing Schema.org definition.

If you have already implemented size schemas using our walkthrough on mapping Shopify size data to schema for AI shopping recommendations, you will follow an identical structural pattern here.

Locating the schema snippet

In your Shopify admin, go to Online Store, click Themes, select the three dots next to your live theme, and click Edit code.

Where the product schema lives depends on how your theme was built:

  • In Dawn and recent Online Store 2.0 themes, check snippets/product-media-gallery.liquid, sections/main-product.liquid, or dedicated snippets such as snippets/structured-data.liquid.
  • Search for application/ld+json across your theme files to locate the primary script tag rendering the Product type.

You are looking for the JSON object containing "@context": "https://schema.org/" and "@type": "Product".

Writing the Liquid expression

In the Schema.org vocabulary, the material property accepts either a text string or a Product entity. For an ecommerce storefront, a clean text string specifying the fabric matches search engine and LLM expectations.

Developers modifying Shopify structured data often encounter syntax breakages when extending template snippets, an issue highlighted in discussions on mapping custom metafields to Google structured data. The most common mistake is outputting a raw Liquid variable without formatting filters or null-checks.

Find the main Product block and insert the material definition using the following pattern:

{% if product.metafields.custom.material != blank %}
  "material": {{ product.metafields.custom.material.value | json }},
{% endif %}

If you defined your metafield as a list of single-line text strings, Liquid can output the array directly into valid JSON using the json filter:

{% if product.metafields.custom.material.value != blank %}
  "material": {{ product.metafields.custom.material.value | json }},
{% endif %}

The .value accessor pulls the underlying content, while the | json filter wraps strings in double quotes and escapes special characters.

The empty-value trap that breaks schema validation

The biggest trap when modifying theme schema is the empty-value bug. If you place "material": "{{ product.metafields.custom.material }}", directly into your schema without a wrapper condition, products missing that metafield will output "material": "",.

Worse, if your syntax leaves a trailing comma before a closing bracket, the entire JSON structure becomes invalid:

{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "Everyday Oxford Shirt",
  "material": ,
  "offers": { ... }
}

When an AI scraper encounters broken JSON, it discards the entire tag. Google drops your rich snippet eligibility, and systems like ChatGPT cannot parse your product specifications at all.

Always wrap your custom schema lines in an if ... != blank condition. If the metafield is empty, the code simply omits the line, preserving clean, valid JSON.

Connect the material data to your Google Merchant Center feed

Editing your storefront theme solves only part of the problem. AI shopping engines collect product facts through two distinct channels: page-level web scraping and verified catalog feeds.

As explained in Lumio's technical guide on Shopify metafields for SEO, a truly functional metafield must clear three hurdles:

  1. It must map cleanly to a recognized Schema.org property.
  2. It must be visible on the storefront page.
  3. It must sync downstream to your Google Merchant Center (GMC) catalog.

A field that exists only in your Liquid template misses platforms that query the Google Shopping graph directly. Google AI Overviews and Gemini draw heavily from Merchant Center data feeds to confirm current price, inventory, and variant specifications.

To bridge this gap, ensure your material metafield maps to Google's standard attributes:

  • If you use Shopify's native Google & YouTube sales channel, map your custom field to the standard material attribute within the app's attribute-mapping settings.
  • If you use a dedicated feed management app, set your rules so that the material feed attribute inherits from product.metafields.custom.material.
  • Verify that your storefront displays the material attribute in visible HTML (such as a specifications accordion or bulleted details list), not just in the hidden JSON-LD tag.

Search engines cross-reference visible page content against structured data payloads. Discrepancies between what a human sees and what your schema claims can trigger trust flags in search algorithms.

Aligning your schema with catalog feeds forms the backbone of an effective technical catalog strategy, a core topic we cover in our guide to AI visibility for DTC brands. When your storefront HTML, JSON-LD block, and Merchant Center feed agree on every fabric specification, AI agents can cite your products with high confidence.

Validating your schema and tracking AI recommendations

Do not assume your theme changes work simply because the Liquid file saved without error. You need to verify that the code renders valid JSON on a live product URL.

Follow this verification checklist:

  • Open a browser and navigate to a product where you populated the material metafield.
  • Right-click and select View Page Source, then search for application/ld+json.
  • Locate the "material" line to confirm that the value outputs with proper quotes and no broken commas.
  • Copy the URL and test it in Google's Rich Results Test and the Schema.org Validator. Verify that the tool recognizes the material property under the Product entity with zero syntax warnings.
  • Test a product that has an empty material metafield to verify that your Liquid condition properly hides the line and leaves the surrounding schema intact.

Once your validation passes, search engine bots will re-index your pages and update their entity graphs.

Traditional rank tracking tools will not tell you if these schema adjustments translate to conversational recommendations. LLMs do not present a list of ten blue links; they evaluate catalog constraints and return one or two specific answers.

To understand whether AI shopping assistants are picking up your updated specifications, use the free AI Visibility Scan from Pendium. The platform simulates real customer queries across ChatGPT, Claude, Gemini, Grok, Perplexity, DeepSeek, and Google AI Overviews, showing you where your products win recommendations, where competitors outrank you, and where missing technical attributes continue to hide your brand.

Visit Pendium.ai to scan your catalog and start tracking your brand's AI search presence.

how-toshopifytechnical-seoai-visibilitydtc

Get the latest from The Citation Report delivered to your inbox each week