How to edit robots.txt on Shopify
for AI crawlers
Shopify writes a default robots.txt for you. You can add your own rules through a theme template. The steps, a safe example, and the cautions Shopify gives.
What Shopify does by default
Shopify generates a robots.txt for every store. Its help centre says the default file works for most stores, and that you can customise it with a theme template called robots.txt.liquid. It recommends using Liquid to add or remove rules, because that lets Shopify keep updating the default rules for you.
Before you start
- Shopify advises working with someone who has code and SEO experience, and removing earlier workarounds (such as a third-party service rewriting robots.txt) before you edit the template.
- Back up your theme (Online Store, then Themes, then the menu next to your theme, then Duplicate).
- Shopify treats this as an advanced customisation and does not support problems that come from it.
The steps
- In Shopify admin go to Online Store, then Themes.
- Next to your theme choose the ... menu, then Edit code.
- Choose Add a new template, pick robots, and create it. This creates
robots.txt.liquid. - Edit the template (below), then Save.
- Open
yourstore.com/robots.txtto see the result.
Shopify's own help article, "Editing robots.txt.liquid", is the reference for the menu path and the template variables. It may have changed since this was written.
An example that keeps Shopify's defaults and adds AI crawler rules
The template loops over Shopify's default rules and prints them, then you add your own groups at the end:
{% 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: ClaudeBot
Disallow: /
Compare this with the example in Shopify's help article before you save, because Shopify may have changed its template variables. If your store does not show the default rules after saving, undo the change and ask a developer.
Shopify's pages for products and collections are the part of your store AI search tools and shoppers are most likely to use. Think before blocking everything.
Which crawlers to name
Most AI crawlers publish a name you can put in robots.txt. Their owners describe different purposes, and you can treat them differently:
- Training crawlers (for example GPTBot, ClaudeBot, CCBot): collect pages that may be used to train models.
- Search crawlers (for example OAI-SearchBot, Claude-SearchBot, PerplexityBot): find pages to show or link in an AI assistant's search answers. Blocking these may make your business less likely to be named there.
- Control tokens (Google-Extended, Applebot-Extended): they do not crawl; they tell Google or Apple whether content already crawled may be used for certain AI purposes. Google says Google-Extended does not affect Google Search ranking.
The lines below block the training-related names and leave search alone. Change them to suit your business. Our AI crawler list says what each name is for, and the AI crawler checker shows what your robots.txt says today.
User-agent: GPTBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: Applebot-Extended
Disallow: /
User-agent: CCBot
Disallow: /
What this does not do
- robots.txt is a request that well-behaved crawlers follow. It does not technically stop anything, and it does not remove content already collected.
- It does not control whether a person using an AI assistant can have it fetch your page; those visits use their own names (for example ChatGPT-User, Claude-User).
- A firewall or bot-protection setting on your host can turn crawlers away whatever robots.txt says. The checker shows both.
After you save
Open yoursite.com/robots.txt in a browser to see the live file, then run the checker to confirm the names are blocked and nothing you wanted allowed got caught. Not sure whether to block at all? Read allowing or blocking AI crawlers in robots.txt.
Written with AI from the platforms' own help pages (read 26 October 2026) and checked against them. Menus and options change: if yours differ, follow the platform's current help page. This is general information, not advice.