Web development

What an XML Sitemap Does and Does Not Guarantee

A desk with a printed list of page addresses next to a laptop showing the public site

An XML sitemap is a file that lists URLs you want search engines to know about. Google says it helps discovery. It does not guarantee that every URL in the file will be crawled or indexed [1]. A CMS often emits one automatically. That file is only as honest as the pages it lists.

Who actually needs one?

Google says a sitemap is useful if the site is large, if it is new and has few links, or if it has rich media such as images. A small site of about 500 pages or fewer may not need one if the pages are well linked [1]. A five-page business site with a clear menu is in that second group. Submitting a sitemap anyway is not harmful. Treating the submission as the reason the site will rank is the mistake.

Does a sitemap force Google to crawl a blocked page?

No. robots.txt decides what the crawler is allowed to fetch. A disallow does not reliably keep a page out of results if other sites link to it, but it does stop the fetch of that URL [2]. If you want a page hidden, Google says to use noindex or a password, and the crawler has to be able to see the noindex [2] [3]. Putting a blocked URL in the sitemap does not unlock it.

What about a page that returns an error?

A 4xx response, other than 429, means Google ignores the content, and indexed URLs that keep returning those errors are dropped over time [4]. A sitemap that still lists a deleted page is asking for a fetch you already know will fail. Remove the URL from the file when you remove the page. Leaving it in does not keep the page indexed.

Should images be in the sitemap?

They can be. Google says an image sitemap can include image files on another domain or a CDN, and the image still has to be a real img with a src, not only a CSS background [5]. The sitemap overview says rich media is one reason to have a sitemap at all [1]. The file does not replace alt text or a stable image URL [5].

What should you submit after a move?

The new site's sitemap, after the redirects are in place and after you have removed noindex and robots blocks from the pages you want crawled [6]. Google's site-move guide says to submit the new sitemap. It does not say the sitemap replaces the redirects. Old URLs belong in the redirect map. New URLs belong in the sitemap.

Can the sitemap choose the preferred URL?

It can hint. Google says a URL listed in a sitemap is one factor in canonicalization, along with HTTPS, redirects, and a rel=canonical annotation. You can state a preference. Google may still choose a different page as the canonical [7]. Listing every filtered copy of a category does not make each copy the one that should rank.

How often should you rebuild it?

When the list of public URLs changes. A new service page, a removed product, a renamed path. After you add markup, Google also says a sitemap is how you tell it about later changes, and finding the new page can still take days [8]. The file is a notification. It is not the crawl itself.

What should you leave out on purpose?

Thank-you pages, internal search results, and a staging hostname. A noindex page can still be listed by accident. Google has to crawl a page to see noindex, and a URL that is noindex can take months to drop if it was already indexed [3]. Do not keep advertising it in the sitemap while you wait.

  • Discovery — the sitemap lists URLs you want found.
  • Not a guarantee — crawl and index are still Google's decision.
  • Small sites — about 500 pages or fewer may not need one if they are well linked.
  • No blocked URLs — a disallow is not fixed by listing the URL.
  • No dead URLs — take down the 404s when you take down the pages.

Where does the file sit in a normal build?

At the end of website development, next to the launch checklist, not as the first SEO task. The pages themselves have to exist and link to each other. Maintenance is when someone notices the sitemap still advertises a page you deleted in March.

What should you look at this week?

Open the sitemap and read ten URLs. If one of them 404s, remove it [4]. If one of them is a staging host or a page you disallowed, take it out [2]. If the site is small and every page is in the menu, you may not need the file at all [1]. Do not add a second sitemap to compensate for a messy one.

Sources & references

  1. Google Search Central: Learn about sitemaps.
  2. Google Search Central: Introduction to robots.txt.
  3. Google Search Central: Block search indexing with noindex.
  4. Google Search Central: HTTP status codes and network errors.
  5. Google Search Central: Google image SEO best practices.
  6. Google Search Central: Site moves with URL changes.
  7. Google Search Central: URL canonicalization.
  8. Google Search Central: Product variant structured data.

Sitemap behavior is described on the linked Google pages. Read the current overview before you submit a file.

If the sitemap and the live pages disagree, we can see which list Google is being handed.

Talk to us arrow_right_alt