A sitemap is one of the few files on a site that exists only to talk to search engines. That makes it easy to build once and never look at again, which is the usual route to a file that quietly lists pages the site no longer wants found. Below I set out what Google says a sitemap is for, what belongs in one, the limits and fields that matter, and how a sitemap stops being honest. Where I go beyond what Google states, I say so. If you want the practical steps, my guide to creating, submitting and checking a sitemap covers them.
What a sitemap is for, and what it is not
Google’s page What Is a Sitemap describes a sitemap as a file where you give information about the pages, videos and other files on your site, and the relationships between them. Search engines read it to crawl a site more efficiently. It tells them which pages and files you think are important, and it can carry details such as when a page was last updated and its alternate language versions.
The same page is clear about the limit. A sitemap helps search engines discover URLs, but it does not guarantee that everything in it will be crawled and indexed. The page Build and Submit a Sitemap adds that submitting a sitemap is merely a hint: Google may not download it or use it for crawling.
Do you need one?
Google says a sitemap is not always needed. If your pages are properly linked, it can usually discover most of your site. A sitemap may help if the site is large, if it is new with few external links, or if it has a lot of rich media or is shown in Google News. You might not need one if the site has about 500 pages or fewer that matter for search, is comprehensively linked internally, and has few media or news pages. My reading is that a sitemap is a safety net and a statement of intent. It does not repair weak internal linking.
What belongs in the file, and what the limits are
When you create a sitemap, Google says, you are telling search engines which URLs you prefer to show in results. Those are the canonical URLs. If the same content is reachable at several addresses, pick the preferred one and list that instead of every variant. Google generally shows canonical URLs in results, and says sitemaps are one way to influence that. My article on how Google picks a canonical URL covers the other signals.
The build page lists practical requirements:
- URLs must be fully qualified and absolute, and Google will try to crawl them exactly as listed.
- The file must be UTF-8 encoded.
- A sitemap at the site root can affect all files on the site, which is where Google recommends posting it. Elsewhere it affects only descendants of its parent directory, unless you submit it through Search Console.
Google supports XML, RSS or Atom feeds and plain text files, and says it has no preference between them. A text sitemap can list only HTML and other indexable pages, one URL per line.
Every format limits a single sitemap to 50MB uncompressed or 50,000 URLs. Beyond that you must split the file. Manage Your Sitemaps With Sitemap Index Files explains the tidy way. An index file lists other sitemaps and is submitted as one file. It can hold up to 50,000 sitemap locations. The sitemaps it references must be on the same site, unless cross-site submission is set up, and in the same directory or lower. You can submit up to 500 index files per site in Search Console. The Sitemaps report help page reports a file over 50MB uncompressed as a size error. The sitemaps protocol says you may compress files with gzip, but the limit applies to the uncompressed size.
lastmod, priority and changefreq
Google is precise about the optional XML fields. It ignores priority and changefreq. It uses lastmod if the value is consistently and verifiably accurate, for example by comparing it with the page’s last modification. The value should reflect the last significant update. Google gives changes to the main content, structured data or links as examples, and a changed copyright date as one that is not significant.
So lastmod is the one field where honesty pays off directly, and where dishonesty is easiest. A generator that writes the build date into every entry breaks the condition Google sets. I treat that as a defect to look for in any audit. Google does not say what happens to a site whose lastmod values are unreliable, beyond saying it uses the value only if it is accurate.
Telling Google where the sitemap is
Google lists three ways to make a sitemap available. You can submit it in Search Console using the Sitemaps report, use the Search Console API, or add a line to robots.txt in the form Sitemap: https://example.com/my_sitemap.xml. The robots.txt line can appear anywhere in the file, can be repeated, and is picked up the next time Google crawls robots.txt.
The Sitemaps report help page adds some behaviour worth knowing. Submitting means telling Google where the file is, not uploading it. The report shows when Google last read the file and a status such as Success, Has errors or Couldn’t fetch. It lists only sitemaps submitted through the report or the API, not those found through robots.txt, though you can submit a discovered one to track it. You need owner permission on the property to submit. Without it, robots.txt is the alternative.
How a sitemap stops telling the truth
Google’s documentation names several failures. A sitemap blocked by robots.txt cannot be fetched, because Google respects robots.txt when fetching sitemaps. URLs that give an error when crawled are reported as not accessible. For redirects, Google suggests replacing redirect URLs in a sitemap with the URLs that should actually be crawled. URLs on a different domain, or at a higher directory level than the sitemap, are reported as not allowed.
Use the figure to trace where each of these breaks the path from a listed URL to the index.
From a URL in a sitemap to the index
Follow the five stages, then select a sitemap problem to see where it stops a URL and what is lost after that point.
- Listed in the fileYou tell search engines which URLs you prefer to show in results. These are the canonical URLs, written as full, absolute URLs.Build and Submit a Sitemap
- Sitemap fetchedYou submit the file in Search Console, through the API, or in robots.txt. Submitting is only a hint, and the file must be fetchable.Build and Submit a Sitemap
- Read without errorsGoogle parses the file. Success means all URLs will be queued for crawling. With errors, the URLs that parsed cleanly are still queued.Sitemaps report - Search Console Help
- URLs crawledGoogle tries each queued URL. It can take time, and not every URL in a sitemap is necessarily crawled.Sitemaps report - Search Console Help
- IndexedA sitemap does not guarantee that listed items will be indexed. The Page indexing report can be filtered by sitemap to see how many were.Sitemaps report - Search Console Help
Where does it go wrong?
- Sitemap blocked by robots.txt
- Wrong sitemap address
- A file over 50MB or 50,000 URLs
- Relative URLs such as /mypage.html
- URLs on another domain or higher up
- Redirecting URLs listed
- URLs that return errors
- Listed, but never indexed
The file cannot be fetched
Google says it respects robots.txt when fetching sitemaps, so a rule that blocks the file leaves the status at Couldn't fetch.
A 404 at the submitted URL
Google lists a wrong URL, giving a 404, as a reason the sitemap cannot be fetched. It suggests opening the address in a browser to check.
Over the size limit
All formats limit one sitemap to 50MB uncompressed or 50,000 URLs. Google reports a larger file as a size error and says to split it.
Not fully qualified
Google says to use fully qualified, absolute URLs, and it will crawl them exactly as listed. It names relative URLs as a cause of URLs not followed.
URL not allowed
Google reports URLs at a higher directory level, or on a different domain, than the sitemap file as not allowed.
URLs not followed
Google suggests replacing any redirect URLs in a sitemap with the URLs that should actually be crawled.
URLs not accessible
When Google meets an error crawling a listed URL, it reports it as not accessible. It suggests inspecting the URL with the URL Inspection tool.
No guarantee
Google says a sitemap helps discovery but does not guarantee that everything in it is crawled and indexed.
Other failures follow from the stated purpose. Google says to list the URLs you want to see in search results. My reading is that a sitemap should not contain noindexed URLs, error pages or non-canonical duplicates. Google’s pages do not list those cases, but each contradicts the file’s own instruction.
My routine is simple. Compare the sitemap with what the site actually serves, then compare the count of submitted URLs with the count indexed. Google documents that the Page indexing report can be filtered by sitemap, and that the discovered-pages figure counts URLs parsed, with no guarantee that any were crawled or indexed. A large gap between the two is a question to investigate, not a verdict.
Where sitemaps fit at Cultured Digital
Sitemaps and robots.txt sit within the crawling and indexing part of my technical SEO work, alongside canonicals and duplication and log-file analysis. My own tool, Link Signals, scans a site starting from its sitemap, including sitemap indexes and compressed files. Where crawling capacity is the real question, my article on when crawl budget matters sets out where Google says it applies.
