Shopify SEO

Shopify’s default robots.txt explained

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

What it blocks

Shopify’s default robots.txt:

  • /admin, /cart, /checkout, /checkouts/, /orders and /account (except /account/login): private or one-off pages.
  • /collections/*sort_by*, /collections/*+* and repeated filter parameters: the same collection in a different order or filter, which would flood Google with near-duplicates.
  • /blogs/*+*: blog tag combinations.
  • /*?*preview_theme_id=* and /*?*oseid=*: theme previews and internal links.
  • /services, /sf_*, /cdn/wpm/*.js, /recommendations/products: Shopify’s own scripts and APIs.
  • Lines like Allow: /products/checkout make sure a product whose handle happens to be “checkout” isn’t caught by the checkout rule.

The adsbot-google group

Google’s ad crawler ignores the * group, so Shopify gives it its own rules: it can read products, collections, pages and blogs for Google Ads checks, but not checkouts or orders.

Change it safely

Keep Shopify’s {% for group in robots.default_groups %} loop in your template and add rules around it. Then Shopify’s future fixes still reach your store. A template that replaces the loop with plain text freezes your robots.txt as it is today.

  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.