how to

Robots.txt on Shopify: what you can and can't change

the short answer

Shopify generates robots.txt automatically and once locked it, but you can now customize it through the robots.txt.liquid template, where you can add rules such as AI-scraper Disallows while Shopify keeps managing its own defaults.

For years, Shopify's robots.txt was completely off-limits. The platform generated a sensible default automatically and gave merchants no way to touch it, which was fine for most stores but frustrating if you wanted to block a specific crawler or tidy up how your collections were indexed. That changed when Shopify introduced the robots.txt.liquid template, giving stores a supported way to add and remove rules without breaking the safe defaults Shopify maintains underneath.

So today the picture is a middle ground. You do not get a free-form text file you can rewrite end to end, and you cannot move robots.txt off the /robots.txt path. What you do get is a Liquid template that lets you inject your own Disallow and Allow directives, including blocks for AI scrapers like GPTBot, ClaudeBot, and CCBot. A set generated by robot.guard maps cleanly onto these template edits, so you can decide which rules to keep from a clean reference and translate them into the liquid file.

~49.6%share of all web traffic that was bots in 2024, per Imperva's Bad Bot Report

What Shopify generates for you

Out of the box, Shopify builds a robots.txt that already disallows the paths that should not be crawled, such as cart, checkout, account, and internal search and filter URLs that would otherwise create endless duplicate pages. It also points to your sitemap. This default is genuinely good for SEO, which is why Shopify long argued there was no need to edit it. For the majority of stores, the generated file does the right thing without any intervention.

The catch was that good defaults are not the same as your defaults. If you wanted to block a particular bot, allow a path Shopify disallowed, or layer in protection against the wave of AI training crawlers, you were stuck. The robots.txt.liquid template exists to close that gap while keeping Shopify in charge of the baseline, so you are adding to a maintained foundation rather than replacing it wholesale.

Editing through robots.txt.liquid

To customize the file, go to your Shopify admin, open Online Store, then Themes, click the three-dot menu, and choose Edit code. Under the Templates folder, add a new template and select robots.txt.liquid from the list. Shopify scaffolds it with its default logic intact, expressed through Liquid objects that loop over rule groups. You then add your own rules around or inside that logic, rather than deleting the defaults, so the safe baseline stays in place.

To add a block, you insert a directive for the user-agent you want to stop. For example, to keep an AI scraper out you add a group that targets GPTBot or ClaudeBot with a Disallow line for the whole site. Because it is Liquid, you can also conditionally remove a default rule if you genuinely need to, but most stores only ever add. Save the template and Shopify will serve the merged result at /robots.txt immediately, no deploy step required.

Translating a robot.guard set into the template

The cleanest workflow is to design your rules in robot.guard first, where you can toggle which search bots to keep allowed and switch on blocks for the curated, maintained list of AI scrapers, then preview the result. You will not paste that file verbatim into Shopify, because Shopify wants its directives expressed through the Liquid template, but the generated output is your reference for exactly which user-agents to Disallow and which paths to leave open.

In practice that means reading each User-agent and Disallow pair from your robot.guard file and adding a matching rule group to robots.txt.liquid. Keep Shopify's existing cart and checkout disallows, leave Googlebot and Bingbot allowed so your search ranking is untouched, and add the AI-scraper blocks on top. Remember the limits: you cannot change the URL, you cannot remove Shopify's deeper structural protections, and your edits live with the theme, so they need re-applying if you switch to a theme that lacks the template.

how it works

  1. 01

    Decide your rules in robot.guard

    Whitelist search bots, toggle on blocks for AI scrapers like GPTBot, ClaudeBot, and CCBot, and preview the generated robots.txt as your reference.

  2. 02

    Open theme code

    In Shopify admin go to Online Store, then Themes, click the three-dot menu, and choose Edit code.

  3. 03

    Add the template

    In the Templates folder, click Add a new template and select robots.txt.liquid. Shopify scaffolds it with the default rules intact.

  4. 04

    Insert your blocks

    Add rule groups that target each AI-scraper user-agent from your robot.guard reference with a Disallow line, layered on top of Shopify's defaults.

  5. 05

    Keep the safe defaults

    Leave Shopify's cart, checkout, and account disallows in place, and keep Googlebot and Bingbot allowed so search ranking is unaffected.

  6. 06

    Save and verify

    Save the template, then visit yourstore.com/robots.txt to confirm your added rules appear alongside Shopify's defaults.

frequently asked

Can I edit robots.txt on Shopify at all?
Yes, now you can. Shopify once locked the file entirely, but it now supports customization through the robots.txt.liquid theme template, where you can add and conditionally remove directives.
Can I block AI scrapers on Shopify?
Yes. In robots.txt.liquid you add rule groups targeting AI-crawler user-agents such as GPTBot, ClaudeBot, and CCBot with a Disallow directive, layered on top of Shopify's default rules.
What can't I change?
You cannot move robots.txt off the /robots.txt path, and you should not strip Shopify's structural protections for cart, checkout, and account URLs. Edits also live with the theme, so they do not carry over automatically when you switch themes.
Will I lose my rules if I change themes?
Possibly. Because robots.txt.liquid is a theme template, a new theme without it falls back to Shopify's defaults. Re-add the template after switching, using your robot.guard set as the reference.

Last updated June 9, 2026

ready to try robot.guard?

start guarding your site