All guides · SEO

XML sitemaps

An XML sitemap is a file that lists the URLs you want search engines to know about, optionally with the date each one last changed:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-10-01</lastmod>
  </url>
  <url>
    <loc>https://example.com/guides/trail-shoes</loc>
    <lastmod>2026-09-14</lastmod>
  </url>
</urlset>

Why it matters

Search engines mostly find pages by following links. A sitemap helps when links are not enough:

  • new sites with few external links;
  • large sites, where some pages sit many clicks deep;
  • pages that change often, where lastmod helps crawlers find updates sooner;
  • pages that are poorly linked internally.

A sitemap is a suggestion. It does not force indexing, and a small, well-linked site can do fine without one. It is still cheap to produce and makes problems easier to spot in Search Console.

What we check

We fetch one sitemap:

  1. the first Sitemap: URL from your robots.txt that is on the scanned host or its www/non-www counterpart;
  2. otherwise, /sitemap.xml on the scanned host.
Result When
Pass the URL returns 200 OK and contains a <urlset> or <sitemapindex> element
Needs attention it returns another status, or the response does not look like a sitemap
Couldn’t test the request failed

The report shows which URL we tried and whether robots.txt declares a sitemap. We follow at most one redirect for this request. We do not unpack compressed .xml.gz files, so a sitemap only offered in gzip form is reported as needing attention even though search engines accept it. We do not check the URLs listed inside.

How to fix

Generate the sitemap automatically. Hand-written sitemaps go stale. Most platforms can do it:

  • WordPress has a built-in sitemap at /wp-sitemap.xml; SEO plugins replace it with their own.
  • Most static site generators and frameworks have an official sitemap plugin or integration.
  • Shop systems usually generate one per store.

Reference it from robots.txt. This is how crawlers (and our check) find a sitemap that is not at /sitemap.xml:

Sitemap: https://example.com/sitemap-index.xml

Use an absolute URL. You can list several Sitemap: lines.

Make sure it returns real XML. Common reasons the check fails:

  • /sitemap.xml returns your HTML 404 page with status 200;
  • a security plugin, firewall or CDN rule blocks bots from the file;
  • the sitemap URL redirects more than once;
  • the file is only available as .gz. Serve an uncompressed version, or let your server compress it on the fly with Content-Encoding: gzip.

What to include

  • Only canonical URLs that return 200 and that you want in search. Leave out redirects, error pages, noindex pages and duplicate URLs with tracking parameters.
  • Full absolute URLs on the same host and scheme as the sitemap.
  • An accurate lastmod. Google uses it when it is consistently correct and ignores it when it is not, so do not set every URL to today’s date. Google ignores priority and changefreq.

Large sites

One sitemap file may contain at most 50,000 URLs and be at most 50 MB uncompressed. Beyond that, split the URLs into several files and list them in a sitemap index:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap><loc>https://example.com/sitemap-pages.xml</loc></sitemap>
  <sitemap><loc>https://example.com/sitemap-products.xml</loc></sitemap>
</sitemapindex>

Then submit the index in Google Search Console, which reports how many URLs were read and any errors. Google’s sitemaps overview has the full rules.

Last updated October 24, 2026