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