How to add robots.txt, llms.txt and schema to a Shopify store
On Shopify you change robots.txt by adding a robots.txt.liquid template under Online Store > Themes > Edit code, and adding your AI crawler rules after Shopify's default groups. You don't need to create llms.txt: Shopify already serves /llms.txt as a mirror of its own /agents.md file. Product schema usually comes from your theme, so check the page source before adding more.

- robots.txt is editable, but only through a theme template: you add
robots.txt.liquidin the theme code editor. Shopify calls it an unsupported customization and warns that mistakes can cost you all your traffic. - The default file allows public pages: Shopify's default robots.txt lets crawlers request products, collections, pages, blogs and policies, and blocks admin, cart, checkout, account and filtered or sorted collection URLs.
- llms.txt already exists on your store: since May 2026 Shopify serves
/agents.mdfor every store, and/llms.txtand/llms-full.txtmirror it by default. - You can override each file:
agents.md.liquid,llms.txt.liquidandllms-full.txt.liquidtemplates replace the defaults. Shopify's advice is to keep the managed default unless you have a real reason. - robots.txt doesn't control Shopify Catalog: if you sell through agentic storefronts such as ChatGPT or Microsoft Copilot, Shopify says your product data reaches them through Shopify Catalog, independently of
/robots.txt. - Product schema is one Liquid filter:
{{ product | structured_data }}outputs a schema.orgProductorProductGroupfor a product page.
Before you start
You need three things:
- Access to the theme code editor, under Online Store > Themes > ... > Edit code, as the store owner or a staff member with theme permissions.
- A copy of your theme. Duplicate the live theme before you edit code, so you can roll back. Shopify notes that uploading a theme in the Themes section won't import
robots.txt.liquid, so keep a copy of that file too. - A decision about AI bots. Decide whether you want to be found in AI answers, kept out of AI training, or both. Our guide on allowing AI search bots but blocking AI training explains each bot.
Step 1: Add AI crawler rules with robots.txt.liquid
Create the template
From Shopify's help page on editing robots.txt.liquid:
- In your Shopify admin, go to Online Store.
- For your live theme, click ... > Edit code.
- Click Add a new template, then select robots.
- Click Create template and save your changes.
Changes are live straight away, but crawlers may take a while to notice. Shopify Support can't help with this file, and Shopify asks you to remove older workarounds, such as rules set in a proxy like Cloudflare, before you edit it.
Keep the defaults, add your rules after them
The new template starts with Liquid that prints Shopify's default rule groups. Keep that loop, so Shopify can keep the defaults up to date, and add your AI rules underneath. This example keeps OpenAI's search crawler in and keeps two training crawlers out:
{% for group in robots.default_groups %}
{{- group.user_agent }}
{%- for rule in group.rules -%}
{{ rule }}
{%- endfor -%}
{%- if group.sitemap != blank -%}
{{ group.sitemap }}
{%- endif -%}
{% endfor %}
User-agent: GPTBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: OAI-SearchBot
Allow: /
OpenAI's crawler overview explains that GPTBot collects training data and OAI-SearchBot finds pages for ChatGPT search, and that each one follows its own robots.txt rules. Shopify's developer guide to customizing robots.txt.liquid shows how to add or remove rules inside the default groups, and strongly recommends the Liquid objects over replacing the whole file with plain text.
Which way to go
| Your goal | What to add to robots.txt.liquid | What you give up |
|---|---|---|
| Be found and cited by as many AI tools as possible | Nothing; the default already allows public pages | Your pages stay open to AI training crawlers |
| Show up in AI search but opt out of training | Disallow: / for training bots such as GPTBot, CCBot, Google-Extended |
Nothing in AI search, as long as you leave search bots alone |
| Keep a section away from all bots | A Disallow: rule for that path in the * group |
Those pages drop out of search crawling too |
| Stop ChatGPT or Copilot showing your products | Not a robots.txt job; use Sales channels > Agentic | See Step 4 |
robots.txt rules are a request, not a lock. Shopify says they're "directional and advisory" and not every crawler follows them. Bot management at the network level is handled by Shopify for you.
Step 2: Check, then decide whether to touch llms.txt
What's already there
Open https://yourstore.com/llms.txt and https://yourstore.com/agents.md. According to Shopify's agents.md.liquid documentation, every store gets a Shopify-managed agents.md that tells AI agents how to browse and buy from it: its Universal Commerce Protocol (UCP) and Model Context Protocol (MCP) endpoints, read-only product and collection URLs, and its published policies. /llms.txt and /llms-full.txt show the same content unless you override them.
This changed in May 2026. If you set up your own llms.txt earlier through an app, a redirect or a proxy, check what the URL serves now. A Shopify Community thread from merchants who were caught out by the change is worth reading. Headless Hydrogen stores may not get these files by default.
When to override it
Shopify looks for templates in this order, and uses the first one it finds:
| URL | Lookup order |
|---|---|
/agents.md |
agents.md.liquid → Shopify default |
/llms.txt |
llms.txt.liquid → agents.md.liquid → Shopify default |
/llms-full.txt |
llms-full.txt.liquid → agents.md.liquid → Shopify default |
To add your own llms.txt, open the code editor, right-click the Templates folder, choose New File and name it llms.txt.liquid. It takes Markdown and Liquid, but only the request and agents objects work there. Standard objects such as shop and collections render blank, so type in your store details or use values like {{ agents.store_name }} and {{ agents.sitemap_url }}. Shopify also warns against putting private data such as contact emails in these files, because they're cached and served to every agent.
A short example that keeps the agent endpoints and adds the pages a shopper asks about:
# {{ agents.store_name }}
> Example Coffee roasts and sells speciality coffee beans in Porto and ships across the EU.
## Shop
- [All coffee](https://example.com/collections/all): beans, roast levels and prices
- [Shipping](https://example.com/policies/shipping-policy): delivery times and costs
- [Returns](https://example.com/policies/refund-policy): how to return an order
## For agents
- Full agent instructions: {{ agents.store_url }}/agents.md
- UCP discovery: {{ agents.ucp_discovery_url }}
- Sitemap: {{ agents.sitemap_url }}
Keep expectations realistic
There's no proof that a custom llms.txt helps. Google's AI optimization guide says you can ignore AI text files like llms.txt for Google Search, and an Ahrefs study of 137,210 domains found that 97% of published llms.txt files got zero requests in May 2026. On Shopify the managed default already covers the basics, so for most stores leaving it alone is the sensible choice. More background in what is llms.txt.
Step 3: Check and fix product schema
See what your theme outputs
Open a product page, view the source and search for application/ld+json. Many themes already print product structured data. Shopify's Liquid has a structured_data filter for this:
<script type="application/ld+json">
{{ product | structured_data }}
</script>
It outputs a schema.org Product for a product without variants and a ProductGroup for a product with variants, including name, brand, image, price, currency, availability and URL. It also works on blog article objects.
Where to add what's missing
| Schema | Where it goes | Notes |
|---|---|---|
Product / ProductGroup |
The product section of your theme, with the filter above | Only add it if the page source shows none, or you'll get two blocks |
Organization |
layout/theme.liquid, inside <head>, or a custom Liquid block |
Name, logo, URL and social profiles |
FAQPage |
The template of an FAQ page | Only for questions and answers shown on that page |
| Shipping and returns | Store policies and product schema | See our guide to shipping and return policy structured data |
Every value in your markup has to match what a shopper sees. An AI assistant that finds one price in your schema and another on the page has a reason to trust neither.
Step 4: Know what robots.txt doesn't control
Shopify's agentic storefronts are active by default for eligible stores and send product data to AI channels such as ChatGPT and Microsoft Copilot through Shopify Catalog. Shopify says blocking AI crawlers in robots.txt "affects only open-web discoverability" and doesn't stop that feed.
So there are two separate switches:
| You want to control | Where |
|---|---|
| Which AI bots crawl your store's pages | robots.txt.liquid |
| Which AI channels get your product data through Shopify Catalog | Sales channels > Agentic in your Shopify admin |
Eligibility rules differ by channel. For ChatGPT, for example, Shopify lists selling to US customers and having your terms of service, privacy policy and refund policy filled in under Settings > Policies.
Step 5: Check everything on the live store
- robots.txt: open
https://yourstore.com/robots.txtand check that your new groups appear after Shopify's defaults, and that theSitemap:line is still there. - llms.txt and agents.md: open both in a private window. If you added a template, check it rendered and that no Liquid shows up blank.
- Schema: paste a product URL into the Schema Markup Validator and Google's Rich Results Test, and make sure there's only one
Productblock. - Outside check: run the free Web2Agents AI check to see how AI bots are treated by your robots.txt and how your homepage scores.
Shopify vs other builders
| Shopify | Squarespace | Wix | Webflow | WordPress | |
|---|---|---|---|---|---|
| Edit robots.txt | Yes, robots.txt.liquid template |
No, one AI checkbox | Yes, Robots.txt Editor | Yes, in Site settings > SEO | Yes, with an SEO plugin or a file |
| llms.txt | Served by default, mirrors /agents.md |
Paste text (7.1 only) | Generated for you on premium plans | Upload a file in Site settings | Yoast or Rank Math can create it |
| Custom JSON-LD | Theme code, structured_data filter |
Code injection on Core and up | Structured Data Markup per page | Head code or the Schema markup field | Added by SEO plugins, or custom code |
The details are in our guides for Squarespace, Wix, Webflow and WordPress. More platform guides are in Platform guides.
Common Shopify mistakes
| Mistake | What happens | Fix |
|---|---|---|
| Replacing the template with plain text | Your file stops getting Shopify's default updates | Keep the robots.default_groups loop and add rules after it |
Blocking OAI-SearchBot along with GPTBot |
Pages drop out of ChatGPT search, not only training | Block training bots by name, leave search bots alone |
| Thinking robots.txt keeps products out of ChatGPT | Shopify Catalog still shares them | Use Sales channels > Agentic |
| An old llms.txt app or redirect | It may no longer be what /llms.txt serves |
Open the URL and check |
Using shop or collections in llms.txt.liquid |
Those values render blank | Use the agents object or type the values in |
| Adding product schema on top of the theme's | Two Product blocks that may disagree | Check the page source first and keep one |
FAQ
Can I edit robots.txt on Shopify?
Yes. Add a robots.txt.liquid template under Online Store > Themes > Edit code and add your rules after Shopify's default groups. Shopify calls it an unsupported customization, so Shopify Support can't help with it.
Does my Shopify store already have an llms.txt?
Yes. Shopify serves /llms.txt on every Online Store as a mirror of its managed /agents.md file. You only need an llms.txt.liquid template if you want different content.
Does blocking AI crawlers stop my products appearing in ChatGPT?
Not on its own. Shopify says robots.txt only affects open-web crawling. Products shared through Shopify Catalog with agentic storefronts such as ChatGPT and Microsoft Copilot are controlled in Sales channels > Agentic.
How do I add product schema to Shopify?
Most themes already output it. If yours doesn't, add a script tag of type application/ld+json containing {{ product | structured_data }} to the product template. Check the page source first so you don't add a second block.
What is agents.md on Shopify?
It's a file Shopify creates for every store at /agents.md that tells AI shopping agents how to find products, read policies and use the store's commerce endpoints. You can override it with an agents.md.liquid template.
Sources
- Editing robots.txt.liquid, Shopify Help Center
- Customize robots.txt, Shopify Dev Docs
- agents.md.liquid and llms.txt.liquid, Shopify Dev Docs
- Customize /llms.txt, /llms-full.txt and /agents.md, Shopify developer changelog, 28 May 2026
- structured_data filter, Shopify Liquid reference
- Shopify agentic storefronts and Selling on ChatGPT, Shopify Help Center
- Shopify Just Killed /llms.txt for all stores. Here's What to Do, Shopify Community
- Overview of OpenAI crawlers, OpenAI
- AI optimization guide, Google Search Central
- We analyzed 137K sites: 97% of llms.txt files never get read, Ahrefs


















