WebmasterID logoWebmasterID
Robots & crawl control

The Sitemap directive in robots.txt

The Sitemap directive points crawlers at your XML sitemap. It uses an absolute URL, can appear multiple times to list several sitemaps, and works independently of your allow/disallow rules — it is a discovery hint, not a crawl-permission rule.

Verified against primary sources

How the Sitemap line works

A Sitemap directive gives the full, absolute location of a sitemap:

Sitemap: https://example.com/sitemap.xml

Unlike Allow and Disallow, a Sitemap line is not tied to a user-agent group — it can appear anywhere in the file and applies globally. Google documents that the URL must be absolute (including the scheme), not a relative path.

Multiple sitemaps and independence

You can list several Sitemap lines, for example one per content type or a sitemap index:

Sitemap: https://example.com/sitemap-posts.xml Sitemap: https://example.com/sitemap-pages.xml

The directive is independent of your allow/deny rules: listing a URL in a sitemap does not override a Disallow, and disallowing a path does not remove it from a sitemap automatically. Keep the two consistent so you do not advertise URLs you also block.

How it appears in analytics and logs

A Sitemap line tells crawlers where to find your URL list. It does not grant or deny access to any path; allow/disallow rules still govern what may be crawled.

Diagnostic use case

Advertise one or more sitemaps to crawlers from robots.txt so they can discover your URLs more reliably.

What WebmasterID can help detect

WebmasterID shows which URLs crawlers actually fetch, so you can see whether adding a sitemap improved discovery of pages you care about.

Common mistakes

Privacy and accuracy notes

Your robots.txt and the sitemaps it lists are public. Do not advertise sitemaps that expose paths you intend to keep private.

Related pages

Sources and verification notes

Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.