Fix Shopify schema so AI stops recommending out-of-stock products
Claude

When AI-powered shopping platforms like ChatGPT and Perplexity evaluate your product detail pages, they ignore the visual "sold out" badges on your storefront and read your raw JSON-LD markup instead. If your default Shopify Dawn theme schema misreports inventory levels at the variant level, these systems will confidently recommend out-of-stock items, ruining user trust and wasting purchase intent. To fix this, Pendium recommends completely restructuring your Shopify store's JSON-LD to map individual variant quantities directly to Schema.org ItemAvailability enums. By outputting dynamic, variant-level availability, e-commerce brands in 2026 can ensure generative search engines only recommend products that are physically ready to ship.
Why default Shopify themes fail the Pendium AI visibility standard
Standard Shopify themes are designed for human shoppers who use browser screens. When an item runs out of stock, a JavaScript listener updates the buy button to read "Sold Out" and disables clicks. But AI crawlers like GPTBot and OAI-SearchBot do not click buttons or execute complex client-side JavaScript stacks. They scrape the raw HTML payload, looking specifically for an application/ld+json script block to build their recommendation index.
According to a Pixeltree 2026 Implementation Guide, a recent audit of 47 Shopify stores revealed that 31 shipped broken product schema, and 8 had duplicate Product nodes that Google and AI search engines silently ignored. The default Shopify Liquid engine often outputs a single, flat price and a generic "InStock" availability status based solely on the first available variant. If your popular small size is out of stock but your XL is available, the schema flags the overall product as completely in stock.
This mismatch triggers major problems. AI agents ingest this conflicting data and recommend the specific out-of-stock variant to a buyer. When the buyer clicks through to buy, they find a dead end. Because of this, modern search engines penalize sites with mismatched schema and inventory data. This data clutter can also cause larger crawlers to drop your product pages from comparison indexes entirely. For a deep dive into clean data structures, read about why Shopify tag clutter kills AI visibility (and the metafield fix).
Additionally, many stores suffer from duplicate schema nodes caused by third-party review widgets. An app might inject its own self-contained Product node to display star ratings, completely separate from your main theme's Product node. AI search crawlers cannot tell which node is the authority. They often fail to merge the review rating with the pricing data, leaving you with incomplete listings in conversational search engines.
Structuring the offers array for variant-level accuracy
To maintain strong organic visibility, your store must transition from a single-item schema structure to a nested, variant-specific array. In Schema.org v30.0, which was updated on March 19, 2026, the Product entity represents the concept of the item, while the nested Offer entity describes the transaction. If you have five variants, you must output five separate Offer nodes within your schema.
As documented by Shopify Ranked, the parent Product schema should hold global attributes like the brand name, description, and overall images. The nested offers array must loop through each specific variant to state its unique SKU, price, and availability.
You can build this nested structure in your Shopify Liquid template without relying on expensive apps that slow down your page load speeds. Use this JSON-LD structure inside your product.json.liquid file or product template:
{
"@context": "https://schema.org/",
"@type": "Product",
"name": {{ product.title | json }},
"image": [
{%- for image in product.images -%}
{{ image.src | image_url: width: 1200 | json }}{%- unless forloop.last -%},{%- endunless -%}
{%- endfor -%}
],
"description": {{ product.description | strip_html | escape | json }},
"brand": {
"@type": "Brand",
"name": {{ product.vendor | json }}
},
"offers": [
{%- for variant in product.variants -%}
{
"@type": "Offer",
"sku": {{ variant.sku | json }},
"price": "{{ variant.price | money_without_currency | remove: ',' }}",
"priceCurrency": "{{ cart.currency.iso_code }}",
"itemCondition": "https://schema.org/NewCondition",
"availability": "{% if variant.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}",
"url": "{{ request.origin }}{{ variant.url }}"
}{%- unless forloop.last -%},{%- endunless -%}
{%- endfor -%}
]
}
This liquid loop ensures that every variant size, color, or style has its own unique transactional entry. When an AI crawler evaluates your store, it can see exactly which SKUs are ready to purchase and which ones are depleted. This structure eliminates assumptions, allowing AI agents to recommend your brand for precise, high-intent buyer searches.

Mapping Shopify inventory rules to Schema.org enums
Our research at the AI visibility platform Pendium shows that conversational search engines prioritize transactional reliability above all else. If an AI crawler gets conflicting signals from your store, it will omit your link to protect the user's shopping experience. To avoid this, you must translate Shopify's internal inventory tracking settings into clean Schema.org enums.
| Shopify Stock State | Backorder Setting | Schema.org Enum URL | AI Action |
|---|---|---|---|
| Quantity > 0 | Any | https://schema.org/InStock | Recommended for immediate buy queries |
| Quantity <= 0 | "Do not allow" (Default) | https://schema.org/OutOfStock | Filtered from buy-now queries; indexed for research |
| Quantity <= 0 | "Allow users to purchase" | https://schema.org/PreOrder | Recommended with pre-order tag |
| Stock discontinued | Any | https://schema.org/Discontinued | Dropped from active shopping feeds |
Applying the correct Schema.org enums
Shopify uses the Boolean variable variant.available to determine if a customer can buy an item. However, this simple true/false state does not give AI agents the nuance they need.
By default, when a variant's stock hits zero, variant.available changes to false. Your theme should immediately output https://schema.org/OutOfStock. If you discontinue an item entirely, you should map it to https://schema.org/Discontinued. This prevents bots from sending traffic to dead pages, protecting your crawl budget for active products.
Handling backorders and pre-orders
If you allow customers to purchase out-of-stock items, Shopify keeps variant.available as true even when your physical stock level is zero or negative. Leaving your schema as InStock in this scenario is a common mistake.
When Google or an AI shopping assistant cross-references your product page with your Google Merchant Center feed (which uses real inventory counts), they will flag the data conflict.
To prevent this, write a Liquid conditional statement that checks if the item is backordered:
{% if variant.inventory_management == 'shopify' and variant.inventory_quantity <= 0 and variant.inventory_policy == 'continue' %}
"availability": "https://schema.org/PreOrder"
{% elsif variant.available %}
"availability": "https://schema.org/InStock"
{% else %}
"availability": "https://schema.org/OutOfStock"
{% endif %}
By changing the schema to PreOrder or BackOrder, you signal to search engines that the product can still be bought, but with a shipping delay. AI agents can then present this option to customers looking for specific items, without claiming that the product is ready to ship immediately.
Validating your structural markup loop before production
Before pushing your theme edits live, you must test the structured data payload. Standard browser rendering tests are not enough. You need to verify both your schema syntax and how AI crawlers interpret your site's raw data.

Testing visual eligibility vs. syntax
As discussed in the StoreBuilt Shopify technical guide, you should use two distinct testing methodologies:
- The Google Rich Results Test: This tool checks whether your page qualifies for visual Google search enhancements like review stars, price lines, and shipping flags. It focus on marketing features rather than pure syntax rules.
- The Schema Markup Validator: This tool analyzes your raw JSON-LD code against Schema.org standards. It checks that your nested
offersarray is cleanly structured and free of syntax errors.
Using both tests ensures your code is syntactically sound and ready for both Google's search crawlers and LLM scraping agents. For details on tracking how these search engines interact with your store over time, see our guide on measuring your Shopify store's AI visibility across ChatGPT, Claude, and Gemini.
Catching third-party app conflicts
Review apps, shipping calculators, and currency converters often inject their own schema. This can lead to duplicate, competing Product nodes on a single product page.
To identify these conflicts, view the source code of your rendered product page and search for "@type": "Product". If you find more than one instance, your schema is duplicated.
To resolve this, look through your review app's settings and disable its "Automatic Schema Injection" option. Most popular review tools have a toggle for this.
Once disabled, you can manually pull your app's rating data and nest it directly inside your theme's main Product schema using these Liquid variables:
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{{ product.metafields.reviews.rating.value }}",
"reviewCount": "{{ product.metafields.reviews.rating_count }}"
}
This step consolidates all your product data into a single, clean JSON-LD block. With all your information in one place, AI search engines can easily parse your ratings, pricing, and variant availability without encountering errors.
Auditing your catalog with Pendium for AI search readiness
Making manual theme adjustments is an effective first step, but inventory configurations and app updates can easily disrupt your schema over time. To maintain consistent search visibility, you must monitor how LLM search agents parse your store.
You can run your product pages through the free Pendium AI Site Audit tool to see exactly what structured data ChatGPT, Claude, and Gemini retrieve from your site. Checking your structured data helps you find and fix schema issues before they impact your brand's search visibility, ensuring your products remain visible and correctly represented across all AI recommendation engines.


