I Help You

Robots.txt for Shopify — Example, Template & Best Practices

QUICK SUMMARY

  • A robots.txt file for Shopify helps control how search engines crawl your store
  • Shopify auto-generates a robots.txt — customise it via robots.txt.liquid
  • Always block /cart, /checkout, and /account
  • Block faceted filter parameters to prevent duplicate collection pages
  • Always include a Sitemap: directive pointing to your store sitemap

A robots.txt file for Shopify helps control how search engines crawl your store — protecting admin pages, reducing duplicate content from filter URLs, and keeping Googlebot focused on your product and collection pages. Shopify generates a default file automatically, but extending it with the right rules can meaningfully improve your crawl efficiency and technical SEO.

Shopify robots.txt template

Use this as a starting point. Extend Shopify's default via your robots.txt.liquid theme file, or use our robots.txt generator to build and download a custom version:

robots.txt
User-agent: *
Disallow: /admin
Disallow: /cart
Disallow: /checkout
Disallow: /account
Disallow: /search
Disallow: /*?sort_by=
Disallow: /*?filter.

Sitemap: https://yourstore.com/sitemap.xml

What each rule does

  • /admin: Your Shopify admin panel. Never expose this to search engines.
  • /cart and /checkout: Transactional pages with no standalone SEO value. Blocking them saves crawl budget for your product pages.
  • /account: Customer login and order history pages. Personal and not indexable.
  • /search: Internal search result pages produce thin, near-duplicate content. Blocking them prevents crawl budget waste.
  • /*?sort_by= and /*?filter.: Faceted navigation creates hundreds of near-identical collection URLs. Blocking these parameters is one of the highest-impact changes for large Shopify stores.

After setting up your rules, test this robots.txt using our robots.txt tester to confirm your product and collection pages are still allowed. For a broader reference, see our robots.txt examples library.

Common Shopify robots.txt mistakes

These errors are easy to miss and can quietly damage your store's rankings.

Blocking collection or product pages

A broad Disallow rule that accidentally covers /collections/ or /products/ removes your most important pages from Google's index. Always test with the URL path tester before saving.

Blocking the Shopify CDN

Product images and theme JavaScript are served from Shopify's CDN. Never add a rule that covers /cdn/ — without it, Google cannot render your pages correctly.

Missing the Sitemap directive

Shopify auto-generates your sitemap at /sitemap.xml. Your robots.txt must point to it so all crawlers can find your products and pages.

Forgetting faceted filter parameters

Unblocked sort and filter URLs create hundreds of duplicate pages. These drain crawl budget and can dilute your product page rankings.

Shopify robots.txt best practices

Follow these principles to keep your Shopify store's crawl setup in good shape.

Extend the default — don't rewrite it

Shopify's generated file is already well-configured. Customise it to add missing parameter blocks rather than replacing everything from scratch.

Block low-value URL parameters

Add Disallow rules for any query strings that produce near-duplicate collection or search pages without unique SEO value.

Include your sitemap URL

Add Sitemap: https://yourstore.com/sitemap.xml at the bottom of the file. Shopify generates this automatically — just point to it.

Test after every change

Use our free robots.txt tester to confirm product and collection pages are allowed before publishing changes to your live theme.

When NOT to use these rules

Applying these directives in the wrong context can harm your store's SEO. Keep these limits in mind:

  • Do NOT block /products/ or /collections/ — these are your core revenue pages that drive all organic traffic.
  • Do NOT block Shopify CDN paths (/cdn/) — product images, theme CSS, and JavaScript files are all served from there.
  • Do NOT block all URL parameters — only target specific low-value ones like ?sort_by= and ?filter. to avoid over-blocking valid pages.

Ready to set up your Shopify robots.txt?

Test your file against real crawl rules, or build a new one from scratch — both tools are free, no login required.

Related robots.txt guides

More platform-specific guides in the series.

Frequently Asked Questions

Common questions about robots.txt on Shopify stores.

Can I edit robots.txt in Shopify?

Yes — since 2021, Shopify lets merchants customise their robots.txt through the theme's Liquid template. In your Shopify admin, go to Online Store → Themes → Edit Code, then find or create a robots.txt.liquid file in the Templates folder. If you are on a headless storefront, you have full control over the file.

What does Shopify's default robots.txt block?

Shopify's auto-generated robots.txt already blocks /admin, /cart, /checkout, /orders, /account, and internal search pages. For most stores this is a solid baseline — the biggest gap is faceted URL parameters that create duplicate collection pages.

Should I block faceted filter URLs in Shopify?

Yes. Filter parameters like ?sort_by=price-ascending or ?color=red generate near-duplicate collection pages that waste crawl budget and split your ranking signals. Add Disallow: /*?sort_by= and Disallow: /*?filter. to prevent Googlebot from indexing these URLs.

Does Shopify auto-generate a sitemap?

Yes. Every Shopify store automatically generates a sitemap at yourstore.com/sitemap.xml, updated whenever you add or remove products and pages. Your robots.txt should always include a Sitemap: directive pointing to this URL.

For configuration patterns across other platforms, see our robots.txt examples and best practices guide.