Search · Term

XML sitemap

An XML sitemap is a file that lists the URLs on a website you want search engines to know about, often with the date each page last changed, to help them discover and recrawl content.

A sitemap is an invitation, not an instruction. Listing a URL does not guarantee it will be crawled or indexed; search engines still decide based on quality, duplicates and their own priorities. It is most helpful for new sites with few links, large sites and pages that are hard to reach through navigation.

It is also different from an HTML sitemap, a page of links written for human visitors. The XML version is written for machines and is rarely looked at by people.

How it works

The file follows the sitemaps protocol: a list of url entries, each with a loc (the address) and optionally lastmod (when it last changed meaningfully). A single sitemap can hold up to 50,000 URLs or 50 MB uncompressed; bigger sites split it into several files listed in a sitemap index. Google ignores the priority and changefreq fields, but uses lastmod when it is consistently accurate.

You tell search engines about it by submitting it in Google Search Console and Bing Webmaster Tools, or by adding a Sitemap line to robots.txt. Most CMS platforms generate and update it automatically. Search engines read the sitemap periodically, not only when it is submitted, so an automatically updated sitemap keeps working without anyone resubmitting it. If the sitemap has errors, such as an invalid format or URLs it is not allowed to list, Search Console reports them in the Sitemaps section. As a rule a sitemap should list only URLs on the site where it is hosted.

A sitemap should list only canonical, indexable pages that return a normal success response. Including redirects, error pages or duplicates teaches search engines that the file is unreliable. Separate sitemaps exist for images, videos and news, and large sites often split sitemaps by section, which makes the reports easier to read: if only one section has indexing problems, it shows up immediately. Sitemaps can be compressed, and the size limit applies to the uncompressed file.

Example

A new recipe site publishes several articles a week but has almost no links from other sites yet. Its CMS generates a sitemap that updates with every post, and the sitemap is submitted in Search Console. The Sitemaps report shows Google reading it, and new recipes are discovered within days rather than waiting for links.

The owner checks the setup by opening the sitemap's address in a browser to confirm it loads and lists the recent posts. In Search Console, the Sitemaps report shows when Google last read it and how many URLs it found. Opening the Page indexing report filtered to that sitemap shows how many submitted pages are indexed and the reasons the rest are not, which points straight to pages needing work.

Why it matters for your business

A clean sitemap speeds up discovery of new and updated pages and gives you a useful report in Search Console comparing what you submitted with what got indexed. It will not fix thin content or make weak pages rank. For a small site with good internal links it is helpful rather than essential, but costs nothing to have. The comparison between submitted and indexed pages is often the most useful indexing check a small site has.

Common mistakes

  • Listing URLs that redirect, return errors, are blocked by robots.txt or carry a noindex tag.
  • Setting every lastmod to today's date on each build, which teaches search engines to ignore it.
  • Including non-canonical duplicates instead of only the preferred version of each page.
  • Submitting a sitemap once and never checking the report for errors.

Questions people ask

Do I need an XML sitemap?

Not strictly, if your site is small and every page is linked from navigation. It is still recommended, because it costs nothing, helps new pages get discovered faster and gives you a useful indexing report in Search Console. Large sites, new sites and sites with many isolated pages benefit most.

How do I submit a sitemap to Google?

Open Google Search Console, choose your property, go to the Sitemaps section, enter the sitemap's URL and submit. You can also add a line such as Sitemap: followed by the full URL to your robots.txt file, which lets any search engine find it.

Does a sitemap guarantee my pages will be indexed?

No. A sitemap helps search engines find URLs, but whether they crawl and index each one depends on quality, duplication, technical access and their own priorities. The Page indexing report in Search Console shows which submitted pages were left out and why.

Related terms

Have something worth building right?