An XML sitemap is one of the oldest tools in technical SEO, and one of the most misunderstood. Site owners treat it as a magic ranking switch, stuff it with every URL they can generate, and then wonder why indexing does not improve. A sitemap is something much simpler: a machine readable list that helps crawlers discover your pages efficiently. Used correctly, it speeds up discovery and gives you diagnostic superpowers. Used carelessly, it actively tells search engines that your site is full of low value pages.

What a Sitemap Does and Does Not Do

A sitemap helps crawlers find URLs, especially ones that are new, deep in the structure, or poorly linked internally. That is the entire job. It does not boost rankings, it does not force indexing, and listing a page there is a hint, not a command. Google and Bing treat the sitemap as one discovery signal among many, alongside internal links, which remain the stronger signal, as we explain in our internal linking guide.

Sitemaps matter most for three kinds of sites: large sites where crawl budget is a real constraint, new sites with few external links pointing in, and sites with content that changes frequently and needs fast recrawling.

The Correct Format

A minimal valid sitemap is short:

<?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-04-21</lastmod>
  </url>
  <url>
    <loc>https://example.com/pricing</loc>
    <lastmod>2026-02-10</lastmod>
  </url>
</urlset>

Only the loc element is required. URLs must be absolute, use the same protocol and host as the sitemap itself, and be properly XML escaped.

lastmod, changefreq and priority: What Search Engines Actually Read

This is where most guides are outdated, so let us be precise.

lastmod is used, if it is honest. Google has confirmed that the lastmod date influences recrawl scheduling, but only when it is accurate. The classic mistake is a dynamic sitemap that stamps every URL with the current date on every request. Search engines quickly notice that everything always claims to have changed today, conclude the field is unreliable, and ignore it for your whole site. Set lastmod to the date the content genuinely last changed, and leave it stable otherwise.

changefreq and priority are effectively ignored. Google has stated plainly that it does not use either field. Bing has said changefreq carries at most a weak hint. Including them does no harm, but spending any effort tuning them is wasted time.

What to Include

The rule fits in one sentence: include every URL you want indexed, and nothing else. In practice that means pages that return status 200, are the canonical version of their content, are not blocked by robots rules, and do not carry a noindex tag.

What to Leave Out

Everything else, and this list deserves attention because sitemap pollution has real consequences.

Redirects and 404s. Every non 200 URL in the sitemap wastes crawl budget and fills your Search Console reports with noise that hides real problems.

Non canonical duplicates. Filter combinations, tracking parameters, print versions and pagination variants belong out. Our canonical URL guide covers how to consolidate these properly.

Noindexed pages. Telling crawlers to visit a page and simultaneously telling them not to index it is a contradiction that only burns crawl resources.

Thin auto generated pages. This is the modern trap. Tools and platforms that generate a page per user, per search query or per data record can pump thousands of near identical URLs into a sitemap. Search engine quality systems evaluate your site partly as an aggregate, and a sitemap declaring that ninety five percent of your site is templated, low text pages drags down how the whole domain is assessed. Curate the sitemap down to pages a human would actually want to land on.

Size Limits and Sitemap Index Files

One sitemap file may contain up to 50000 URLs and 50 megabytes uncompressed. Larger sites split URLs across multiple files and list those files in a sitemap index, which looks like a sitemap of sitemaps. Splitting by content type, for example posts, products and categories in separate files, has a bonus benefit: Search Console shows indexing statistics per file, turning your sitemap structure into a free monitoring dashboard.

Compression with gzip is supported everywhere and recommended for large files.

Telling Search Engines Where It Is

Two mechanisms cover everything. First, add a line to robots.txt, which every crawler reads:

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

Second, submit the sitemap once in Google Search Console and Bing Webmaster Tools. Submission also unlocks the indexing reports, which are the main practical payoff: you can see exactly how many listed URLs are indexed, and which ones were excluded and why.

Common Technical Mistakes

Wrong content type. Serve the file as application/xml or text/xml. Some misconfigured servers return XML as text/html, which several parsers reject.

Mixed protocols and hosts. A sitemap on https listing http URLs, or a www sitemap listing non www URLs, creates mismatches that get URLs silently dropped.

Invisible characters. A byte order mark or stray whitespace before the XML declaration breaks parsing. If a validator complains about line one, this is usually why.

Forgotten staging URLs. Generated sitemaps sometimes leak development hostnames into production. Audit after every migration.

How to Verify Yours

Open the sitemap in a browser and confirm it renders as XML. Spot check a handful of URLs and confirm each returns 200 and is the canonical address. Confirm robots.txt references it. Then run the CheckMy.site scanner, which checks sitemap presence, validity, the robots.txt reference and dozens of related crawlability signals as part of its 158 point report. Five minutes of sitemap hygiene now saves weeks of confused indexing debugging later.