How to Add Your Sitemap to robots.txt on Shopify & WooCommerce

errorThe Problem

Your robots.txt file doesn't include a Sitemap directive pointing to your XML sitemap. While Google can find sitemaps through Search Console, having it in robots.txt is a best practice that ensures all search engines can discover your sitemap automatically.

trending_upWhy It Matters for SEO

The Sitemap directive in robots.txt is the most reliable way to tell every search engine where your sitemap lives. This helps Google, Bing, and others discover new pages faster — especially important for stores that frequently add products. Without it, search engines rely on crawling links alone, which can miss deep or orphaned pages.

buildHow to Fix It

  1. 1

    Shopify automatically generates robots.txt with a Sitemap directive — this issue usually means a custom robots.txt override is missing it.

  2. 2

    Go to Online Store → Themes → Edit Code → Templates.

  3. 3

    Look for a robots.txt.liquid file. If it exists, check that it includes a Sitemap line.

  4. 4

    If using a custom robots.txt, add the Sitemap directive at the bottom.

  5. 5

    Verify at yourdomain.com/robots.txt that the Sitemap line appears.

folderTemplates/robots.txt.liquid
# In robots.txt.liquid, ensure this line is at the bottom:
Sitemap: {{ shop.url }}/sitemap.xml
menu_bookRead Google's official documentationopen_in_new

Related Fix Guides

Want to check if YOUR store has this issue?

Scan your site for free — get copy-paste fixes in 60 seconds.

searchScan Now — It's Free