What is an XML sitemap?

DEFINITION

An XML sitemap is a file that lists the important URLs on your website so search engines can discover and crawl them more efficiently.

An XML sitemap is a machine-readable list of the pages you want search engines to know about, usually found at a URL like example.com/sitemap.xml. Each entry includes a <loc> tag with the page URL and often a <lastmod> date showing when it last changed meaningfully. A single sitemap can hold up to 50,000 URLs or 50MB uncompressed; larger sites split them into several files linked from a sitemap index.

Most content management systems and SEO plugins generate sitemaps automatically and update them when you publish.

Why XML sitemaps matter

Search engines mainly discover pages by following links, but a sitemap acts as a direct list of what you consider important. It is especially helpful for new sites with few external links, large sites with deep pages, and sites that publish or update content often. Accurate lastmod dates help crawlers prioritize recently changed pages. A sitemap does not guarantee indexing, but it improves discovery.

How to submit and check it

Add your sitemap URL in the Sitemaps section of Google Search Console and in Bing Webmaster Tools, and reference it in robots.txt. Search Console then shows how many URLs were discovered and links to indexing details. For example, if your sitemap lists 400 product pages but only 250 are indexed, the Pages report helps you see why the rest were excluded, such as duplicates or quality issues.

Best practices

  • Include only canonical, indexable URLs that return a 200 status.
  • Update lastmod only when page content meaningfully changes, not on every visit or build.
  • Split very large sitemaps by content type, such as products, categories and blog posts.
  • Resubmit the sitemap in Search Console after major changes such as a migration, since Google no longer supports the old sitemap ping endpoint.

Common mistakes

  • Listing redirected, noindexed or 404 URLs, which sends conflicting signals.
  • Setting every page's lastmod to today's date, which makes the field unreliable.
  • Forgetting to update the sitemap after moving to a new domain or URL structure.
Try it free: SEO CheckerCheck any web page for 25+ SEO problems in seconds: title, meta description, headings, speed, HTTPS, schema and more. Free, no sign-up.

Frequently asked questions

Do small websites need an XML sitemap?

A small, well-linked site can be crawled fine without one, but a sitemap is easy to add and helps search engines find new pages faster. It also unlocks useful indexing reports in Search Console. For most sites, there is little reason not to have one.

What is the difference between an XML sitemap and an HTML sitemap?

An XML sitemap is written for search engines and is not meant for visitors. An HTML sitemap is a regular web page listing links to your main sections to help people navigate. HTML sitemaps can aid internal linking, but the XML version is what you submit to search engines.

Do priority and changefreq tags matter?

Google has said it ignores the priority and changefreq values in sitemaps. It does use lastmod when that value is consistently accurate. You can leave priority and changefreq out without any downside and focus on keeping URLs and lastmod dates correct.

Need help with this?

Référencement naturel (SEO) by VYZEON — Soyez trouvé en premier — sur chacun de vos marchés.

Fixed packages from $149/mo. Written scope, no surprises.

See Référencement naturel (SEO)

Related terms

More SEO terms