How crawlers find a sitemap
A sitemap only helps once a crawler knows where it is. The Sitemap line in robots.txt, submission in Google Search Console and Bing Webmaster Tools, the retired ping endpoint, and IndexNow for announcing changed URLs.
Type: IntermediateOn this page
Nothing in the Sitemaps protocol fixes a file name or location for a sitemap. /sitemap.xml is a habit, not a rule, and a crawler that has not been told where the file is has no reason to look for it. There are two durable ways to tell it: a line in robots.txt, which every crawler that reads robots.txt can see, and direct submission to a search engine. A third route, IndexNow, announces individual changed URLs instead of a whole sitemap.
The Sitemap line in robots.txt
User-agent: *
Disallow: /drafts/
Sitemap: https://example.com/sitemap.xml
Sitemap: https://example.com/docs/sitemap-index.xml
Sitemap: https://static.example.net/sitemaps/example-com.xmlThe rules come from sitemaps.org, and RFC 9309 makes room for them:
- The URL is absolute. sitemaps.org gives the full URL, scheme included, as the form to use.
- The line belongs to no group. It applies regardless of the user-agent lines around it. RFC 9309 section 2.2.4 classes Sitemap as one of the other records and says such a record must not end a group, so a Sitemap line between two rules does not cut the group in half. Putting it at the end of the file keeps that question from arising.
- More than one is allowed. A site can list each sitemap, or a single sitemap index that names the rest. See sitemap index files.
- The sitemap can be on another host. The third line points to a file on static.example.net. Because example.com's own robots.txt names it, sitemaps.org treats that as proof that the owner of example.com controls the file, and the URLs in it may belong to example.com.
Google says it finds a sitemap listed in robots.txt the next time it crawls the robots.txt file. Every crawler that reads robots.txt can find the line, which makes it the one method that works without an account with any search engine.
Submitting to a search engine
Google Search Console. After verifying ownership of the site, add the sitemap URL in the Sitemaps report. The report then shows when Googlebot last read the file and any errors it found while processing it. Google describes submission as a hint: it does not guarantee that Google will crawl the listed URLs. A sitemap submitted here is also exempt from the rule that a sitemap may only list URLs below its own directory.
Bing Webmaster Tools offers the same kind of submission for Bing after the site is verified.
The ping endpoint is gone
The Sitemaps protocol still describes a ping: an HTTP GET to a search engine's /ping?sitemap= address with the sitemap URL as a parameter. Many content management systems sent one after every change. Google announced on 26 June 2023 that its ping endpoint would stop working six months later and that requests to it would then return 404. Google said these unauthenticated submissions were not very useful and that, for Google Search, the vast majority led to spam. It pointed site owners to robots.txt and Search Console instead, along with an accurate lastmod. Old code that still sends pings does no harm, and does nothing.
IndexNow
IndexNow is a protocol that Microsoft Bing and Yandex launched in October 2021 for telling search engines that specific URLs were added, changed or deleted. It does not replace a sitemap: it says which URLs to look at now, while the sitemap remains the full list. A submission to one participating engine is shared with the others.
Create a key
A string of 8 to 128 characters, using letters, digits and hyphens.
Publish the key file
Serve a UTF-8 text file named after the key, containing the key, at the root of the host, for example https://example.com/4c6f2a9e8b1d4e7fa0c3b5d6e9f81234.txt. The file can live elsewhere on the host if each request names it in keyLocation, but its location then limits which URLs it can cover.
Send changed URLs
A GET request to the engine's /indexnow endpoint submits one URL. A POST with a JSON body submits up to 10,000.
POST /indexnow HTTP/1.1
Host: www.bing.com
Content-Type: application/json; charset=utf-8
{
"host": "example.com",
"key": "4c6f2a9e8b1d4e7fa0c3b5d6e9f81234",
"keyLocation": "https://example.com/4c6f2a9e8b1d4e7fa0c3b5d6e9f81234.txt",
"urlList": [
"https://example.com/docs/install",
"https://example.com/docs/events"
]
}| Code | Meaning |
|---|---|
| 200 | URLs received. |
| 202 | URLs received; key validation is pending. |
| 400 | Invalid format. |
| 403 | Key not valid, for example because the key file is missing or does not contain the key. |
| 422 | The URLs do not belong to the host, or the key does not match the protocol schema. |
| 429 | Too many requests, a possible sign of spam. |
A 200 only means the request arrived; it does not mean the URLs will be crawled or indexed. The registry at indexnow.org listed seven participating engines on 5 December 2026: Microsoft Bing, Yandex, Seznam, Naver, Yep, the Internet Archive and Amazon. Google was not among them.
Common questions
Does a sitemap at /sitemap.xml get found without a Sitemap line?
No specification asks crawlers to look for it there. List it in robots.txt or submit it.
Link to this answerIs the Sitemap line case-sensitive?
RFC 9309 lets crawlers be lenient about other records, including common misspellings. Google's documentation treats field names as case-insensitive. Writing it as Sitemap, as sitemaps.org does, avoids relying on either.
Link to this answerShould a site use both IndexNow and a sitemap?
They do different jobs. The sitemap lists every URL for any crawler that reads it; IndexNow pushes changes to the engines that take part. Google reads the first and not the second.
Link to this answerSee also
- Sitemap XML formatEvery element of the Sitemaps 0.9 XML format, with the size limits, encoding and escaping rules, which fields Google uses, and the RSS, Atom and text alternatives.
- Sitemap index filesA sitemap index is an XML file that lists other sitemaps instead of pages. It is required once a site passes 50,000 URLs or 50 MB in one sitemap, and it is useful well before that for splitting a site by section.
- robots.txt syntax: groups, rules and matchingReference for the robots.txt file format as standardized in RFC 9309: groups and user-agent lines, allow and disallow rules, the * and $ characters, comments, and the longest-match rule that decides which line applies to a URL.
- Where site files live: the root path and /.well-known/Clients find machine-readable site files at fixed addresses: some at the root of each host, some under the /.well-known/ prefix of RFC 8615, and some inside every page. Where a file sits also decides which URLs it can speak for.
References
- Sitemaps XML format: Informing search engine crawlers. sitemaps.org sitemaps.org
- RFC 9309: Robots Exclusion Protocol, section 2.2.4 rfc-editor.org
- Build and submit a sitemap. Google Search Central developers.google.com
- Sitemaps ping endpoint is going away. Google Search Central Blog, 26 June 2023 developers.google.com
- Bing Webmaster Tools bing.com
- IndexNow documentation. indexnow.org indexnow.org
- IndexNow participating search engines registry (searchengines.json) indexnow.org
- IndexNow: Instantly index your web content in search engines. Bing Webmaster Blog, 18 October 2021 blogs.bing.com