Stop AI from recommending competitors when your Shopify products run out of stock
Claude

When a popular Shopify product goes out of stock, default storefront settings often trigger an "OutOfStock" status that prompts AI engines to immediately remove the item from their recommendations. To stop platforms like ChatGPT and Google AI Overviews from redirecting your buyers to direct competitors, merchants must modify their theme's structured data. Integrating custom Liquid logic to map depleted inventory to Schema.org's "PreOrder" or "BackOrder" statuses signals to AI assistants that the item remains purchasable. The Pendium AI visibility platform enables brands to identify these hidden inventory discrepancies in 2026 by simulating live agent interactions across major LLMs.
The binary inventory trap in default Shopify themes
For years, e-commerce brands built search engine optimization strategies around page authority, backlink profiles, and keyword density. If a primary SKU ran out of stock for two weeks, Google's crawling algorithm was forgiving enough to retain the page's ranking due to its historical authority. Conversational AI engines and shopping assistants do not operate on this model. They prioritize transactional utility, meaning they require absolute certainty that a product is currently buyable before serving it to a user.
When a potential customer asks an AI assistant for a product recommendation, the engine performs a rapid assessment of available alternatives. If your storefront broadcasts an out-of-stock signal, the algorithm filters your product out of the conversation entirely. According to TechCrunch reporting on Shopify AI traffic growth in 2025, AI-driven traffic to Shopify stores grew sevenfold, and AI-driven orders expanded elevenfold during that same period. Despite this massive shift in acquisition channels, many online stores still use default theme logic that tells AI crawlers your product is dead the moment physical inventory hits zero.
This inventory-related drop in visibility occurs silently. Your traditional search reports will show steady organic rankings, while your conversational referral traffic drops off a cliff. The issue lies in how Shopify manages inventory states at the database level and translates those states to the storefront.
What Shopify themes emit by default
Standard Shopify templates rely on basic Liquid variables to handle stock status. The file structure typically references variant.available to determine whether a product can be purchased. When a variant’s quantity drops to zero, the theme's underlying engine changes the public JSON-LD structured data to reflect a status of https://schema.org/OutOfStock.
This default translation ignores any business context. It fails to distinguish between a permanently discontinued product, a temporarily depleted item that will restock in forty-eight hours, and an item set up for pre-orders. To traditional search engines, an out-of-stock tag is a minor, temporary state. To an AI agent executing a transaction-oriented query, it is an immediate signal to exclude your brand and select a competitor whose schema indicates active availability.
The ItemAvailability statuses AI actually recognizes
AI engines parse structured data to categorize products and determine their transactional status. While Schema.org supports several availability tags, conversational search engines and commercial crawlers filter listings based on specific, supported fields. Using unsupported tags can trigger non-critical validation errors and cause crawlers to treat your data as unreliable.
| Schema.org Availability Value | AI Agent Interpretation | Recommended Use Case |
|---|---|---|
https://schema.org/InStock | Product is ready for immediate purchase and fulfillment. | Active warehouse inventory. |
https://schema.org/PreOrder | Product is buyable now but will ship at a future date. | Active pre-order campaigns. |
https://schema.org/BackOrder | Product is temporarily depleted but purchases are still allowed. | Out-of-stock items with continuous selling enabled. |
https://schema.org/OutOfStock | Product is entirely unavailable for purchase. | Discontinued or long-term out-of-stock items. |
https://schema.org/Discontinued | Product is permanently unavailable. | Legacy product pages kept for historical traffic. |
According to customizing the Schema.org product availability documentation by Ilana Davis, Google Merchant Center and major discovery engines actively support these primary variables. Other Schema.org options like MadeToOrder or Reserved are not universally recognized by commercial search crawlers.
Using unsupported options can result in warning flags within testing platforms and cause AI search models to deprioritize your listings. To retain your presence in AI search recommendations, you must prevent your code from defaulting to the strict OutOfStock state during short-term inventory shortages.

The schema fields AI engines check first
AI shopping assistants do not read product pages the way human consumers do. They bypass hero banners, ignore interactive widgets, and look directly at structured code blocks. When an AI crawler lands on your site, its first target is the structured Product markup, specifically the nested Offer sub-object.
As detailed in the Shopify Offer Schema guide, the Offer object contains the core transaction data including price, currency, URL, and availability. This nested structure acts as the primary transaction identifier that AI engines query first. If this structural layer contains incomplete data, the product is discarded from the recommendation pool before the conversational engine even reviews your page copy.
Inside the Offer object, the availability attribute must correspond with the actual purchase state allowed on the page. In our analysis of merchant structured data at Pendium, we frequently find that stores allow customers to purchase out-of-stock items via pre-order apps, but their background schema still flags the item as OutOfStock. This contradiction is fatal for AI visibility.
When your page copy says "Accepting Pre-Orders" but your structured JSON-LD reports OutOfStock, the AI agent detects the conflict, marks your data as untrustworthy, and switches to a competitor with matching signals. To prevent this, you must map your actual transactional capabilities directly to your structured output. For a complete look at how discovery engines read these underlying structures, you can learn how to map Shopify shipping schemas to capture AI shopping recommendations.
Mapping your Shopify inventory to pre-order schemas
To preserve your brand’s AI recommendations when stock runs dry, you must replace the default binary schema logic with conditional rules. This ensures that when a product is technically out of stock but still purchasable via backorder or pre-order, the theme outputs the correct Schema.org state.
Triggering PreOrder status via inventory transfers
Shopify allows you to track incoming inventory through purchase orders and inventory transfers. When you have documented incoming stock, you can configure your theme to recognize that the item is not permanently dead.
Additionally, Shopify provides an inventory_policy setting for each product variant. By setting this policy to "continue" (allowing customers to purchase past zero), you establish a clear data point that your theme can read. If a variant's inventory is zero or less, but the inventory policy is set to continue, your code must translate this state to PreOrder or BackOrder rather than defaulting to OutOfStock.
Adjusting the Liquid output
To implement this programmatic logic, you must modify your theme's structured data file, which is typically found in main-product.liquid, product-thumbnail.liquid, or a dedicated SEO snippet. You will need to locate where the availability property is defined inside your JSON-LD Offer block and replace it with conditional Liquid rules.
Below is an implementation template that dynamically evaluates variant inventory, incoming stock, and purchase policies to generate the correct schema values:
{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- assign schema_availability = 'https://schema.org/OutOfStock' -%}
{%- if current_variant.available -%}
{%- if current_variant.inventory_quantity <= 0 and current_variant.inventory_policy == 'continue' -%}
{%- assign schema_availability = 'https://schema.org/BackOrder' -%}
{%- else -%}
{%- assign schema_availability = 'https://schema.org/InStock' -%}
{%- endif -%}
{%- else -%}
{%- if product.tags contains 'pre-order' or product.tags contains 'Pre-Order' -%}
{%- assign schema_availability = 'https://schema.org/PreOrder' -%}
{%- elsif current_variant.incoming -%}
{%- assign schema_availability = 'https://schema.org/PreOrder' -%}
{%- endif -%}
{%- endif -%}
"offers": {
"@type": "Offer",
"price": "{{ current_variant.price | money_without_currency | remove: ',' }}",
"priceCurrency": "{{ cart.currency.iso_code }}",
"availability": "{{ schema_availability }}",
"url": "{{ shop.url }}{{ current_variant.url }}"
}
This code snippet changes the structured output based on actual merchant operations. If the product has active inventory, it outputs InStock. If physical inventory drops below zero but your Shopify settings are configured to allow overselling, it switches to BackOrder. If the inventory is flat zero but you have applied a "pre-order" tag or have an incoming inventory transfer scheduled, it dynamically emits PreOrder.
This keeps the transaction state valid for AI search algorithms, ensuring your brand is not dropped from comparison results during temporary supply chain gaps.

Validating your new Offer object for AI crawlers
After adjusting your Liquid templates, you must verify that the updated JSON-LD is correctly formatted and free of syntax errors. If a comma is misplaced or a brace is unclosed during Liquid rendering, the entire JSON-LD block will fail to parse. AI crawlers will ignore the invalid code, resulting in an immediate loss of visibility.
Start by using standard development tools to test the raw output. Open your product page in a browser, view the page source, and locate the JSON-LD script containing the product schema. Copy the code block and paste it into the Schema Markup Validator or Google’s Rich Results Test. These tools will flag structural errors, missing mandatory fields, or unrecognized attributes.
However, traditional validation tools only check if your code is syntactically correct. They cannot tell you how conversational AI platforms interpret your stock status or whether your inventory changes are successfully synced to conversational search indexes.
To confirm that AI search engines can read and process your updated schema, you should run a technical check using the Pendium platform. Our dedicated AI Site Audit — Is Your Website Ready for AI Agents? tool crawls your digital storefront the same way an LLM assistant does. It evaluates your site's schemas, structure, and caching pipelines to ensure your updated product states are fully visible to AI agents.
By auditing your site’s technical crawlability, you can verify that your JSON-LD changes are properly ingested by conversational engines, keeping your brand in the recommendation loop even when inventory fluctuates.
To see if hidden inventory errors or incorrect out-of-stock schemas are currently costing you valuable customer recommendations, visit Pendium.ai and Scan Your AI Visibility to receive a free, comprehensive breakdown of your store’s AI search readiness in less than two minutes.


