How do I reference my sitemap in robots.txt?
It's a best practice to always reference your XML sitemap(s) in your robots.txt file.
Here are the rules of engagement:
- Reference the absolute URL to your XML sitemap
- You can reference multiple XML sitemaps
- You can reference regular XML sitemaps, and XML sitemap indices
- You can reference XML sitemaps on another domain, meaning: if your domain is
example.comand your XML sitemap is on
example2.comthen you can reference that domain.
On top of this, we always recommend also submitting your XML sitemaps through Google Search Console and Bing Webmaster Tools.
Audit your robots.txt and find out right away!