XML sitemap

An XML sitemap is a file that lists the URLs of a website you want search engines to crawl and index, optionally with the date each was last changed. It helps discovery but does not guarantee indexing.

An XML sitemap is a machine-readable list of pages on your site. It tells search engines which URLs exist and which ones you consider important, so they can find them without relying only on links. Most CMS platforms and SEO plugins generate one automatically.

What goes in it. Each entry has a loc element with the full URL. You can add lastmod, the date the content last changed in a meaningful way. Google uses lastmod when it is consistently accurate and ignores the priority and changefreq fields completely. There are also extensions for images, videos and news, and the sitemap format can carry hreflang annotations for international sites.

Limits. One sitemap file may hold up to 50,000 URLs and be at most 50 MB uncompressed. Larger sites split their URLs over several files and list them in a sitemap index file.

How to submit. Add a Sitemap line to robots.txt and submit the sitemap or index in the Sitemaps report of Google Search Console. Bing Webmaster Tools accepts sitemaps as well, which also matters for AI assistants that use Bing's index.

Best practices:

  • Only include canonical, indexable URLs that return a 200 status. No redirects, 404s, noindex pages or parameter duplicates.
  • Keep lastmod honest. Updating it on every page every day teaches Google to ignore it.
  • Split sitemaps by type (articles, products, categories) so you can see indexing per section in Search Console.
  • Make sure new content appears in the sitemap quickly, especially on news and publisher sites.
  • Use absolute URLs with the correct protocol and hostname.

What a sitemap does not do. It is a hint, not an instruction. Listing a URL does not force indexing, and it will not rescue a page with weak content. A sitemap also does not replace internal linking. If a page is only in the sitemap and nowhere in your navigation or content, it is an orphan page, and Google tends to treat it as less important.

Using it as a diagnostic tool. Comparing the URLs in your sitemap with the indexed pages in Search Console is one of the quickest ways to spot problems. A large gap between submitted and indexed pages in one section points to quality, duplication or crawl issues worth investigating.

Questions about XML sitemap

Do I need an XML sitemap?

Small, well-linked sites can be found without one, but a sitemap is cheap to set up and helps with discovery and monitoring. Large sites, new sites and sites with lots of fresh content benefit most.

Does Google use priority and changefreq?

No. Google ignores both fields. It does use lastmod when the dates are consistently accurate.

How many URLs can an XML sitemap contain?

Up to 50,000 URLs and 50 MB uncompressed per file. Use a sitemap index to combine several files.

Related terms