Robots & Sitemap Checker

Guides › Platforms

Shopify robots.txt: how to edit robots.txt.liquid

Shopify generates a robots.txt for every store, with sensible defaults that block cart, checkout, account and internal search URLs. You can customise it by adding a robots.txt.liquid template: Online Store › Themes › Edit code › Add a new template › robots.txt.

Add a rule to the default group

{% for group in robots.default_groups %}
  {{- group.user_agent }}
  {%- for rule in group.rules -%}
    {{ rule }}
  {%- endfor -%}
  {%- if group.user_agent.value == '*' -%}
    {{ 'Disallow: /*?q=*' }}
  {%- endif -%}
  {%- if group.sitemap != blank -%}
    {{ group.sitemap }}
  {%- endif -%}
{% endfor %}

Block an AI crawler

Append a new group after the loop:

User-agent: GPTBot
Disallow: /

Keep the Liquid loop so you keep Shopify's defaults; deleting it removes all the standard protections. Shopify serves the sitemap at /sitemap.xml (an index). Check the result with the checker.

Check your site now

Related

WordPress robots.txt: default rules and how to editNext.js: robots.ts and sitemap.ts (App Router)

More free tools from Swift Labs

OG Preview Tool
Preview links on Facebook, LinkedIn, X and Slack, and audit Open Graph tags.
Email DNS Check
Check SPF, DKIM, DMARC and MX records in seconds.
DeadLinkPatrol
Find broken links across your whole site.