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
- Online Store › Themes › … on your theme › Duplicate.
- Make the change on the copy, preview it, and publish only when it works.
The theme code editor (to paste a snippet)
How to get this: The theme code editor
- On the copy of your theme: … › Edit code.
- Hover the snippets folder, click New File…, name it as the tool says, paste and Save.
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.
- Build your rules in the robots.txt Builder and download robots.txt.liquid.
- 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.
- Under Templates click Add a new template and choose robots.txt. Shopify creates templates/robots.txt.liquid with its default code.
- Select all of that code, paste the downloaded template over it and click Save.
- 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.
- 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.
- 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.