Skip to content

robots.txt.liquid · Sitemap directive

Adding Extra Sitemaps via robots.txt.liquid

Shopify's default robots.txt already includes a Sitemap directive pointing to the auto-generated /sitemap.xml. The robots.txt.liquid template exposes a Liquid sitemap object3 with directive (returns "Sitemap") and value (the URL) properties. Extra sitemap URLs can be declared by adding Sitemap lines below the default loop — useful for app-generated image sitemaps, video sitemaps, or a separate news sitemap. Per Shopify's docs, this is one of the four supported customisations.

Published Verified 2026-05-22

What the Sitemap directive does

The Sitemap directive is a line in robots.txt that tells crawlers where to find one or more sitemap files. Format: Sitemap: https://example.com/sitemap.xml. Each declaration must be a full URL (not a relative path). Multiple Sitemap lines are valid — Google, Bing, and other major crawlers read all of them. The directive is hint-only: declaring a sitemap doesn't guarantee crawling, but it does ensure the crawler knows the sitemap exists without needing manual submission.

Google's sitemap doc4 confirms multi-sitemap declarations are supported and that each declared URL can itself be a sitemap index file pointing to child sitemaps. On Shopify the auto-generated /sitemap.xml is already a sitemap index for stores large enough to need URL splitting.

Shopify's default sitemap directive — already there

The default-rendered Shopify robots.txt includes a Sitemap directive pointing to /sitemap.xml. The directive is auto-emitted by the default-groups loop — specifically by the group.sitemap conditional inside Shopify's verbatim default template. Stores without a custom robots.txt.liquid still get this directive automatically. Stores with a custom robots.txt.liquid that preserves the default loop also still get it. Stores that replaced the default loop with plain text lose the auto-generated Sitemap directive and have to declare it manually.

liquid The Liquid block that emits the default Sitemap directive
 {%- comment -%} Verbatim from Shopify Dev Docs — emits the Sitemap directive {%- endcomment -%} {% for group in robots.default_groups %} {{- group.user_agent -}} {% for rule in group.rules %} {{- rule -}} {% endfor %} {%- if group.sitemap != blank -%} {{ group.sitemap }} {%- endif -%} {% endfor %} 

The group.sitemap object emits a complete Sitemap: https://yourstore.com/sitemap.xml line per group when the group has a sitemap declared. On a default Shopify store, this resolves to a single Sitemap line for the wildcard user-agent block.

The Liquid sitemap object

Per Shopify Dev Docs, the sitemap Liquid object exposes two properties. sitemap.directive returns the literal string 'Sitemap' — useful for emitting the directive without hard-coding the keyword. sitemap.value returns the sitemap URL — the URL itself, e.g. https://yourstore.com/sitemap.xml. Together they let theme code emit Sitemap directives generated from the platform's internal state rather than hard-coded paths.

The cleaner way to think about it: the sitemap object lets the Liquid template stay platform-aware. If Shopify ever changes the auto-sitemap URL (currently /sitemap.xml), templates using {{ group.sitemap }} automatically pick up the change. Templates hard-coding Sitemap: https://yourstore.com/sitemap.xml would not.

Adding extra sitemap URLs (image, video, app feeds)

To add an extra sitemap, append a hard-coded Sitemap line below the default-groups loop. The format is plain text: Sitemap: https://yourstore.com/path-to-extra-sitemap.xml. Multiple Sitemap lines are valid. Common sources for extra sitemaps: a third-party app that generates an image sitemap or video sitemap, a separate news sitemap for Shopify blogs that publish frequently, or an externally-hosted sitemap for content syndicated from another domain.

liquid robots.txt.liquid with an extra sitemap declaration
 {% for group in robots.default_groups %} {{- group.user_agent -}} {% for rule in group.rules %} {{- rule -}} {% endfor %} {%- if group.sitemap != blank -%} {{ group.sitemap }} {%- endif -%} {% endfor %} # Extra sitemap declarations Sitemap: https://yourstore.com/apps/image-sitemap/sitemap.xml Sitemap: https://yourstore.com/apps/blog-news-sitemap/news-sitemap.xml 

Verify each URL responds with a valid XML sitemap before declaring it. A broken extra-sitemap URL doesn't break the default sitemap, but it does generate noise in Google Search Console's Sitemaps report (the failed sitemap stays flagged with errors until it's fixed or removed from robots.txt).

When extra sitemaps are justified

Extra sitemaps earn their keep on three workloads. (1) Image sitemaps for stores with substantial visual content — a fashion brand with 50+ product photos per PDP can benefit from a dedicated image sitemap, typically generated by a third-party SEO app. (2) Video sitemaps for stores with embedded product videos or shoppable video content. (3) Blog news sitemaps for stores publishing high-frequency editorial content that needs faster Google News inclusion. For most Shopify stores under 1,000 products, the default /sitemap.xml is sufficient and extras add complexity without benefit.

Audit before adding: Google Search Console's Sitemaps report shows how the default /sitemap.xml is performing. If discovered URL counts match expected counts and indexing rates are healthy, an extra sitemap won't move the needle. The honest 80/20 take: most Shopify SEO problems are not "Google can't find my URLs" — they're "Google found my URLs but the content is thin." Extra sitemaps don't help with the second problem.

For the underlying robots.txt.liquid mechanics, see the cluster hub. For the auto-generated sitemap this directive points to, see /shopify-seo/sitemap/.