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
Shopify automatically generates robots.txt with a Sitemap directive — this issue usually means a custom robots.txt override is missing it.
- 2
Go to Online Store → Themes → Edit Code → Templates.
- 3
Look for a robots.txt.liquid file. If it exists, check that it includes a Sitemap line.
- 4
If using a custom robots.txt, add the Sitemap directive at the bottom.
- 5
Verify at yourdomain.com/robots.txt that the Sitemap line appears.
# In robots.txt.liquid, ensure this line is at the bottom:
Sitemap: {{ shop.url }}/sitemap.xmlRelated Fix Guides
How to Fix Robots.txt Blocking Important Pages
Your robots.txt is blocking Google from crawling important pages. Learn how to fix robots.txt on Shopify and WooCommerce to stop losing organic traffic.
How to Fix Missing Canonical Tags on Shopify & WooCommerce
Fix missing canonical tags on your Shopify or WooCommerce store. Copy-paste code included. Prevent duplicate content from tanking your SEO rankings.
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