To make your products eligible for display in AI platforms such as GPTBot, Perplexity, and others, your Shopify store must allow AI bots to crawl your site and include the structured data these platforms use to understand product details.
Step 1: Add crawl permissions for AI Bots in Shopify
1️⃣ Open your theme code editor
Go to your Shopify admin → Online Store → Themes
Next to your live theme, click “Actions → Edit code.”
2️⃣ Create or edit robots.txt.liquid
If you already have a custom file:
Open Templates → robots.txt.liquid
If you don’t see it:
Click “Add a new file”
Name it robots.txt.liquid
Save it in the Templates folder.
3️⃣ Add this code
Paste the snippet below inside that file (replace any existing content if it’s blank) and click ‘SAVE’ in the upper-right corner
4️⃣ Save the file
Click Save in the upper-right corner.
5️⃣ Verify it’s live
Open a browser and visit: https://yourstore.com/robots.txt
{% comment %}
Custom robots.txt for Shopify
Allows AI crawlers like GPTBot to index public product pages
while blocking checkout and customer areas
{% endcomment %}
User-agent: *
Allow: /
Disallow: /checkout
Disallow: /cart
Disallow: /orders
Disallow: /account
Disallow: /admin
# Allow GPTBot (OpenAI crawler)
User-agent: GPTBot
Allow: /
# Optional: Allow other AI/search bots
User-agent: Googlebot
Allow: /
User-agent: Bingbot
Allow: /
User-agent: Applebot
Allow: /
# Help crawlers find all your products
Sitemap: https://yourstore.com/sitemap.xml
This makes:
✅ Public pages crawlable:
All of your product, collection, blog, and content pages — exactly what AI crawlers (and search engines) need to discover and understand your catalog.
✅ Private pages blocked:
Sensitive or dynamic URLs (/checkout, /cart, /orders, /account, /admin) are safely disallowed, so bots can’t index or access transactional content.
✅ GPTBot explicitly allowed:
You’re now signaling to OpenAI that it’s safe to crawl your public site, meaning your product data becomes eligible for inclusion in future GPT-powered shopping results and content discovery.
Step 2: Update the products.liquid file to include structured data (JSON-LD) and included aggregated ratings and reviews if available
1️⃣ Open your theme code editor
Go to Shopify Admin → Online Store → Themes
Next to your live theme, click Actions → Edit code
2️⃣ Find your product template
In the left sidebar, look for:
Templates → product.liquid
or (for Online Store 2.0 themes like Dawn, Sense, etc.):Sections → main-product.liquid
If you have both, add it to the one that controls your product page content (usually the one with product details like title, price, description, etc.).
3️⃣ Scroll to the bottom of the file
Place your cursor right before the closing tag:
</body> (if it’s there)
or{% schema %} (if you’re editing a section file)
This ensures your structured data loads on every product page without interfering with design or functionality.
4️⃣ Paste the full JSON-LD snippet
Copy and paste this entire snippet:
{%- comment -%}
============================
JSON-LD: Product structured data
Includes optional aggregateRating when review data is present
============================
{%- endcomment -%}
{%- assign first_variant = product.selected_or_first_available_variant -%}
{%- assign rating_value = blank -%}
{%- assign review_count = blank -%}
{%- if product.metafields.reviews.rating.value -%}
{%- assign rating_value = product.metafields.reviews.rating.value | round: 1 -%}
{%- elsif product.metafields.okendo.star_rating_average -%}
{%- assign rating_value = product.metafields.okendo.star_rating_average | round: 1 -%}
{%- elsif product.metafields.judgeme.badge_average -%}
{%- assign rating_value = product.metafields.judgeme.badge_average | round: 1 -%}
{%- endif -%}
{%- if product.metafields.reviews.rating_count -%}
{%- assign review_count = product.metafields.reviews.rating_count -%}
{%- elsif product.metafields.okendo.review_count -%}
{%- assign review_count = product.metafields.okendo.review_count -%}
{%- elsif product.metafields.judgeme.review_count -%}
{%- assign review_count = product.metafields.judgeme.review_count -%}
{%- endif -%}
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"name": {{ product.title | json }},
"image": [
{%- for image in product.images -%}
{{ (image.src | img_url: 'master' | prepend: 'https:') | json }}{% unless forloop.last %},{% endunless %}
{%- endfor -%}
],
"description": {{ product.description | strip_html | strip_newlines | escape | json }},
{%- if first_variant.sku %}
"sku": {{ first_variant.sku | json }},
{%- endif -%}
{%- if first_variant.barcode %}
"mpn": {{ first_variant.barcode | json }},
{%- endif -%}
"brand": {
"@type": "Brand",
"name": {{ product.vendor | json }}
},
"url": {{ (shop.url | append: product.url) | json }}{% if rating_value and review_count %},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": {{ rating_value | json }},
"reviewCount": {{ review_count | json }}
}{% endif %},
"offers": {
"@type": "AggregateOffer",
"url": {{ (shop.url | append: product.url) | json }},
"priceCurrency": {{ shop.currency | json }},
"offerCount": {{ product.variants.size }},
"lowPrice": {{ product.price_min | money_without_currency | replace: ',', '' | json }},
"highPrice": {{ product.price_max | money_without_currency | replace: ',', '' | json }},
"availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}",
"itemCondition": "https://schema.org/NewCondition"
}
}
</script>
5️⃣ Save your changes
Click Save (top right corner).
This snippet now loads structured data dynamically for every product page.
6️⃣ Test your structured data
Open a product page → right-click → View Page Source → search for application/ld+json.
You should see your JSON data.
Then, paste that product URL into Google’s Rich Results Test.
You should see:
✅ Product detected
✅ (optional) Review snippets if you have ratings
This makes:
✅ GPTBot and AI crawlers can now read your product pages like a structured database — not just raw text — which increases the chance your listings appear in AI-driven shopping and product recommendation results. GPTBot or search bots that crawl your site will see this JSON-LD and can index it for use in AI shopping experiences.
✅ Google and Bing can generate rich product previews (price, image, star ratings, availability) directly in search or AI overviews.
✅ OpenAI’s ChatGPT shopping integrations (rolling out through Shopify partnership) will be able to match your product data to user queries automatically.
How products display in AI platforms
Once your store is crawled by AI bots your products are eligible to appear in their platforms. Here are some examples of what product listings look like in ChatGPT and Perplexity.
ChatGPT
Comments
0 comments
Please sign in to leave a comment.