Shopify SEO

Block AI crawlers like GPTBot and ClaudeBot on Shopify

What you’ll need

  • A duplicate of your theme to test on

    How to get this: A duplicate of your theme to test on
    1. Online Store › Themes › … on your theme › Duplicate.
    2. Make the change on the copy, preview it, and publish only when it works.

    Step-by-step guide (opens in a new tab)

  • The theme code editor (to paste a snippet)

    How to get this: The theme code editor
    1. On the copy of your theme: … › Edit code.
    2. Hover the snippets folder, click New File…, name it as the tool says, paste and Save.

    Step-by-step guide (opens in a new tab)

Build my robots.txt

Training bots vs search bots

Most AI companies now run separate crawlers for training and for search. Blocking one doesn’t block the other, so you can say no to training and still get traffic from AI answers.

  • Training: GPTBot (OpenAI), ClaudeBot (Anthropic), Google-Extended (Gemini), Applebot-Extended (Apple), CCBot (Common Crawl), meta-externalagent (Meta), Bytespider (ByteDance).
  • AI search: OAI-SearchBot (ChatGPT search), Claude-SearchBot, PerplexityBot. Blocking these takes you out of those answers.
  • User-triggered: ChatGPT-User, Claude-User, Perplexity-User fetch a page when someone asks about it. OpenAI and Perplexity say these may not follow robots.txt, because a person asked.
  • Google-Extended doesn’t affect Google Search or AI Overviews. Googlebot handles those, and blocking Googlebot removes you from Google.
What a training-bots block looks like in robots.txt
# AI training crawlers: blocked
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: CCBot
Disallow: /

Does robots.txt really stop them?

The big AI companies say their crawlers follow robots.txt. It’s a request, not a lock: a badly behaved scraper can ignore it. To stop those you need a firewall or bot-blocking service in front of your store, which Shopify doesn’t offer on standard plans.

Add it to Shopify

  1. Build your rules in the robots.txt Builder and download robots.txt.liquid.
  2. In Shopify go to Online Store › Themes. To try it first, click ⋯ › Duplicate on your current theme and use the copy; otherwise use your current theme. Click ⋯ › Edit code.
  3. Under Templates click Add a new template and choose robots.txt. Shopify creates templates/robots.txt.liquid with its default code.
  4. Select all of that code, paste the downloaded template over it and click Save.
  5. On a copy: click Preview, then open yourstore.com/robots.txt in the same browser. While you preview a theme, Shopify serves that theme’s robots.txt, so you can check it against the builder’s preview. Then publish the copy.
  6. On your current theme the change is live as soon as you save. Open yourstore.com/robots.txt and check it matches the builder’s preview.
  7. To undo, delete templates/robots.txt.liquid. Shopify goes back to its default robots.txt.

More guides

Based on Shopify’s robots.txt.liquid docs, Shopify’s Help Center and Google’s robots.txt spec.