Sitemap.xml is a machine-readable file that lists the URLs on your site you want search engines to crawl and index, along with when each one last changed. It speeds up discovery of new and updated pages, feeds the Sitemaps report in Google Search Console, and takes minutes to set up. It doesn't boost rankings and it doesn't guarantee indexing. This guide covers what the file actually does, who needs one, and how to build and maintain a sitemap that search engines take seriously.

Sitemaps sit in a strange spot in SEO advice. Half the internet treats them as a magic indexing button, the other half calls them useless because Google finds links anyway. Both takes miss what the file is for, and most published sitemaps carry fields Google openly says it ignores. So let's set the record straight, with Google's documentation as the referee.

50,000
URLs max per sitemap file (or 50 MB uncompressed). Bigger sites split into multiple files.
Google Search Central
2 of 4
standard fields Google ignores outright: changefreq and priority. Most generators still write them.
Google Search Central
~500
pages or fewer, well linked internally: Google says you may not need a sitemap at all
Google sitemap docs

What Sitemap.xml Actually Is

Google's definition, from its sitemap documentation: "a file where you provide information about the pages, videos, and other files on your site, and the relationships between them." In practice, for most sites, it's a plain XML file at the root of your domain listing your URLs. A complete, valid sitemap can be this small:

sitemap.xml
<?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-07-14</lastmod>
  </url>
  <url>
    <loc>https://example.com/services/</loc>
    <lastmod>2026-07-01</lastmod>
  </url>
</urlset>

That's not a simplified teaching example. The sitemap serving the site you're reading is exactly this shape, five URLs long, and you can open it right now. XML is the standard format, but Google also accepts RSS and Atom feeds, and even a plain text file with one URL per line.

What a Sitemap Does (and What It Doesn't)

Three real jobs:

  • It accelerates discovery. Google finds URLs by following links, and a sitemap hands over the full list directly. That matters most exactly when link-following works worst: new sites with few external links, big sites where deep pages sit many clicks down, and freshly published pages nothing links to yet.
  • It carries metadata crawlers can use. An honest lastmod tells Google which pages changed and deserve a recrawl. Extensions can describe images, videos, news articles and language versions of the same page.
  • It switches on reporting. Once submitted in Search Console, the Sitemaps report shows how many listed URLs are indexed, and you can filter the Page indexing report to just your sitemap URLs. That turns "is Google seeing my content?" from a guess into a number.

And the two jobs it never does. It won't push rankings: a sitemap is a crawling aid, not a quality signal. And it won't force indexing. Google's docs say it plainly: "a sitemap helps search engines discover URLs on your site, but it doesn't guarantee that all the items in your sitemap will be crawled and indexed." If your pages are crawled and still not indexed, the sitemap isn't your problem; my indexing troubleshooting guide is the tool for that job.

Do You Actually Need One?

Google's own criteria are refreshingly honest. You likely need a sitemap if the site is large, if it's new with few external links pointing at it, or if you publish lots of media or news content. You may not need one if the site has "about 500 pages or fewer" and every important page is reachable through internal links.

My take after years of audits: build one anyway. The cost is minutes, most platforms generate it automatically, and the Search Console reporting alone pays for the effort. "Technically optional" and "not worth having" are different things. Answer the questions below for a recommendation matched to your site.

Roughly how many pages does your site have?

The Four Tags, and Which Ones Google Actually Reads

Every URL entry supports four standard fields. Here's each one with Google's documented treatment, which is not what most sitemap generators assume:

TagWhat it saysHow Google treats it
<loc>The page URL. RequiredRead and used. Must be the absolute, canonical URL
<lastmod>Date of the last significant changeUsed, but only "if it's consistently and verifiably accurate"
<changefreq>How often the page supposedly changesIgnored
<priority>Your opinion of the page's importance, 0.0 to 1.0Ignored

Source: Google's sitemap build documentation, which states "Google ignores priority and changefreq values" in exactly those words. Search Engine Land's sitemap guide notes Bing has expressed distrust of changefreq too.

Translation: that generator plugin dutifully stamping priority 0.8 on every page is decorating a file for a reader who skips those lines. A sitemap with just loc and an honest lastmod does everything a fully decorated one does. Setting priority to 1.0 everywhere has never rescued a single ranking.

What Belongs in a Sitemap (and What Doesn't)

Think of your sitemap as a statement to Google: "these are my real pages, index these." Every URL that contradicts that statement teaches Google to trust the file less. The rule from Google's docs: include canonical URLs you want in search results, nothing else.

Include

  • Canonical URLs you want ranking in search
  • Pages returning a clean 200 status
  • Indexable pages (no noindex, not robots-blocked)
  • Absolute https URLs, exactly as canonicalized
  • Honest lastmod dates, updated on real changes

Why the strictness matters: URL Inspection and the Page indexing report treat sitemap membership as your declaration of intent. Put a noindexed URL in the sitemap and you've told Google "index this" and "don't index this" about the same page. Google resolves the contradiction fine, but every mixed signal makes your site's metadata a little less believable, and you'll chase phantom "issues" in Search Console that are really just sitemap clutter.

Creating Yours

Three routes, by site type:

  1. CMS platforms. WordPress ships a native sitemap at /wp-sitemap.xml, and SEO plugins like Yoast or Rank Math replace it with a smarter one that updates on every publish and respects your noindex settings. Shopify, Wix and Squarespace generate sitemaps automatically. Your job is not creation, it's verification: open the sitemap URL and check what's actually in it.
  2. Static and custom sites. Every major static site generator has a sitemap plugin, and any build script can emit one from your page list. Make generation part of the build so the sitemap can't drift out of date.
  3. Tiny sites. Under a couple dozen URLs, a hand-written file like the example above is completely fine. Update it when you publish. This site does exactly that.

Whatever the route, the technical requirements from Google's docs: UTF-8 encoding, fully qualified absolute URLs, at most 50,000 URLs and 50 MB uncompressed per file. Validation is simple: open the file in a browser, and if it renders as XML without errors, you're most of the way there. Search Console will flag the rest.

Big Sites: the Sitemap Index

Past 50,000 URLs you must split your sitemap. A sitemap index is a sitemap of sitemaps, and it looks like this:

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

Here's the trick worth knowing even below the limits: split by content type anyway once you have a few hundred URLs per type. Separate sitemaps for posts, products and categories mean Search Console reports indexing per section. When products index at 40% while posts sit at 95%, you've localized a problem that a single merged sitemap would have averaged into invisibility.

Specialized extensions exist for images, videos and news, plus hreflang annotations for language versions. Most sites don't need them; news publishers and international sites do.

Submitting and Referencing It

Google learns about your sitemap three official ways, and you should use the first two:

  1. Search Console. Indexing, then Sitemaps, paste the URL, Submit. This is the one that switches on reporting. Full walkthrough in my Search Console setup guide. If the report says "Couldn't fetch" minutes after submission, wait a few hours before troubleshooting: it's usually queue lag, not a real failure.
  2. robots.txt. One line makes the sitemap discoverable by every crawler, including Bing and the AI crawlers, with no accounts needed:
robots.txt
Sitemap: https://example.com/sitemap.xml

The third route, the Search Console API, matters for platforms managing many sites programmatically. One thing none of these do: re-submitting an unchanged sitemap over and over. Google rechecks submitted sitemaps on its own schedule, and deleting and re-adding the same file achieves nothing.

Keeping It Trustworthy

The whole value of lastmod rests on one sentence in Google's docs: it's used "if it's consistently and verifiably accurate". Google checks your claims against what it finds when it recrawls. Two failure patterns kill that trust:

  • The eternal now. Dynamic sitemaps that stamp every URL with today's date on every request claim the whole site changed every day. A few crawls later Google can see the pages didn't change, and your lastmod becomes noise. Tie the date to actual content edits.
  • The frozen file. A hand-made sitemap from the site launch, never touched again: old URLs that now redirect, new pages missing entirely. Worse than no sitemap, because it actively misdescribes the site.

The maintenance rule is one line: the sitemap changes when the site changes, automatically if possible. Publish a page, it appears. Delete a page, it disappears. Change content significantly, lastmod moves. That's the entire discipline, and on a good setup it costs zero ongoing effort.

Mistakes That Cost Real Traffic

From audits, in rough order of frequency:

  1. Redirects and dead URLs in the sitemap. Common after migrations: the sitemap still lists old URLs that now 301. Google follows them, wastes fetches, and flags the mismatch in Search Console.
  2. Noindexed URLs in the sitemap. The classic mixed signal, usually a plugin listing pages another plugin noindexed. Pick a lane per URL; my meta tags guide covers the robots directives side.
  3. lastmod refreshed everywhere, daily. See above. You get one credibility budget for that field.
  4. Non-canonical variants. The sitemap says http or non-www while canonical tags say https and www. Every URL in the sitemap should match its canonical exactly, character for character.
  5. Staging URLs in production. A build pipeline that bakes dev hostnames into the deployed sitemap. Nobody notices, because nobody opens the file. Open the file.
  6. A sitemap nothing references. Generated, uploaded, never submitted in Search Console, never mentioned in robots.txt. It helps no one there. Two minutes fixes it.
  7. Expecting the sitemap to fix indexing. If pages are crawled but not indexed, the discovery layer already worked. The problem lives in content or site quality, and the fix lives in my indexing guide, not in this file.

The Sitemap Hygiene Checklist

Run this on your live sitemap today

  • The sitemap URL opens in a browser and renders valid XML
  • Every URL is absolute, https and matches its canonical exactly
  • No redirects, 404s, noindexed or blocked URLs inside
  • Every page you want ranking is present
  • lastmod reflects real content changes, not generation time
  • changefreq and priority removed, or at least ignored knowingly
  • File under 50,000 URLs and 50 MB, split with an index if bigger
  • Submitted in Search Console and showing "Success"
  • Referenced in robots.txt with a Sitemap: line
  • Regenerates automatically when content is added or removed

Want Someone to Check the Whole Crawl Path?

The sitemap is one link in the chain: robots.txt, canonicals, redirects, internal links and rendering all decide what Google actually indexes. I check the full chain in my free audit, personally, and tell you what I'd fix first.

Get My Free Audit

Sitemap.xml: FAQ

Not directly. It speeds up discovery and gives you the Sitemaps report in Search Console, but Google states it doesn't guarantee crawling or indexing, and it carries no ranking weight. The indirect value is real: faster discovery of new pages and earlier detection of indexing problems.
Google says sites with about 500 pages or fewer that are well linked internally may not need one. I still add a sitemap to every site I work on: it costs minutes, updates itself on most platforms, and gives you per-URL indexing data in Search Console you can't get any other way.
Every time content is published, significantly updated, or deleted. On most platforms this happens automatically. What matters is that lastmod stays honest: Google uses the field only when it's consistently accurate.
No. Google documents that it ignores both. A sitemap with just loc and an honest lastmod does everything a fully decorated one does, with less to maintain and less to get wrong.
An XML sitemap is a machine-readable file for crawlers. An HTML sitemap is a normal page of links for human visitors, which also spreads internal link value. Different jobs, no replacement relationship. Most sites only strictly benefit from the XML one.
Right after submission it's usually queue lag, not an error, so give it a few hours. If it persists: open the sitemap URL in an incognito window, confirm it returns 200 with valid XML, and check robots.txt isn't blocking the file itself.
Milan Georgijevic, technical SEO consultant
Milan Georgijevic
Technical SEO Consultant & Developer

I'm a developer who moved into technical SEO. I audit sites, then implement the fixes myself: indexing, Core Web Vitals, structured data, rendering. Sitemap hygiene is one of the first things I check on any audit. Request a free technical audit and I'll take a look personally.

All SEO Guides