Indexing guide
Sitemap Directive in Robots.txt
The Sitemap directive is one of the safest robots.txt lines to add: it points crawlers to the XML sitemap that lists your indexable pages.
Short answer
Add your sitemap as an absolute URL on its own line, for example: Sitemap: https://example.com/sitemap.xml. You can list more than one sitemap, and the directive can appear anywhere in robots.txt, but placing it after the crawl rules keeps the file easy to audit.
Correct syntax
User-agent: *
Allow: /
Sitemap: https://example.com/sitemap.xmlThe value after Sitemap: should be an absolute URL. Relative paths like /sitemap.xmlare common in HTML links, but robots.txt sitemap directives should use the full URL so crawlers know exactly which host owns the sitemap.
Why it helps indexing
Search engines can discover pages through internal links, external links, and submitted sitemaps. The robots.txt Sitemap directive adds one more stable discovery path. It is especially useful for new domains, large sites, and programmatic SEO pages where crawl budget and canonical discovery matter.
For AEO and GEO, the sitemap also helps answer engines find the pages that carry your structured data, FAQ answers, direct-answer blocks, and reference tables. It does not guarantee ranking, but it reduces discovery friction.
Build the file
Frequently asked questions
Can robots.txt contain multiple Sitemap lines?+
Yes. You can list multiple XML sitemap URLs, one per Sitemap line. This is common when a site splits pages into sitemap indexes, image sitemaps, news sitemaps, or separate sections.
Does the Sitemap directive have to match the same domain?+
The safest setup is to point to a sitemap on the same canonical host. Search engines can process cross-host sitemap relationships in specific verified setups, but most sites should keep robots.txt and the sitemap on the same hostname.