Free website & SEO check: see your score in under a minute  ·  Check my website →Premium Windows software for marketers: talk to us for access and pricing  ·  Explore the software →
Fundamentals Updated May 22, 2026  ·  9 min read

What is an XML Sitemap? The Complete 2026 SEO Guide

The first thing I tell anyone learning this: a sitemap doesn't make Google rank you. It makes Google find you. That one distinction clears up about half the confusion people carry around about sitemaps. Picture the table of contents you'd hand someone before they read your book. It says "here are all the chapters that exist," which saves them from flipping through page by page to discover them, but it doesn't make any chapter better. This guide walks through what an XML sitemap actually is, the handful of fields inside it, the variants for images and large sites, and the details (which URLs to include, keeping lastmod honest, when to split into multiple files) that trip up most beginners.

Quick verdict: An XML sitemap is a plain text file at yoursite.com/sitemap.xml that lists every URL you want search engines to find. It speeds up discovery, it does not influence rankings, and most sites should have one.

How Sitemaps Actually Help

Without a sitemap, search engines discover pages by following links. Googlebot lands on your homepage, follows internal links to category pages, follows those to article pages, and so on. This works for well-linked sites, but breaks down in three common cases:

  • Deep navigation. A page that takes 5+ clicks from the homepage may never get discovered organically.
  • Orphan pages. Pages with no internal links pointing to them are invisible to link-following crawlers.
  • New content. Brand-new articles can take days or weeks to be found via natural crawling. Sitemap discovery is hours.

A sitemap solves all three by giving Google an explicit list of URLs to consider, independent of whether they're well-linked internally.

The Anatomy of an XML Sitemap

The minimal valid sitemap looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yoursite.com/</loc>
    <lastmod>2026-05-22</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://yoursite.com/blog/</loc>
    <lastmod>2026-05-20</lastmod>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

Five required and optional tags. Only <loc> is mandatory.

TagRequired?What it does
<loc>YesThe canonical URL. Must be absolute (https://…), URL-encoded, under 2,048 characters.
<lastmod>OptionalWhen the page was last meaningfully changed. Google uses it for crawl scheduling.
<changefreq>Ignored by GoogleHint about how often the page changes. Google ignores this; Bing partially respects it.
<priority>Ignored by Google0.0-1.0 relative importance. Google ignores it; it has no SEO impact.
<url> wrapperYesWraps each URL block. The urlset can contain up to 50,000 url entries.
In 2026, only <loc> and <lastmod> meaningfully affect crawler behavior. The rest is optional and largely ignored.

Why Lastmod Is the Only Metadata That Matters

Google has publicly stated multiple times that it ignores <changefreq> and <priority>. The one piece of metadata that influences behavior is <lastmod>.

Lastmod tells Google whether your page has changed since the last crawl. If it has, Googlebot is more likely to re-crawl and update its index. If it hasn't, Google can deprioritize re-crawling and focus on pages that have actually updated.

The catch: lastmod has to be accurate. Setting lastmod to today's date on every URL every day is a known anti-pattern — Google notices the dishonesty and starts ignoring your lastmod values entirely.

Best practice: lastmod should reflect when the page's content changed, not when the file was last written to disk. A page that's had no content changes in 6 months should have a lastmod from 6 months ago.

The Different Types of Sitemaps

TypePurposeWhen to use
Standard XMLList of regular HTML pagesEvery site needs this
Sitemap indexParent file referencing multiple sitemapsSites over 50,000 URLs, multi-language, multi-section
Image sitemapLists image URLs with metadataImage-heavy sites (e-commerce, photography, design)
Video sitemapLists video URLs with title/duration metadataVideo content publishers
News sitemapSpecial format for Google News inclusionNews publishers approved for Google News
Hreflang sitemapLanguage/region variantsInternational sites with translated content
HTML sitemapHuman-readable navigation pageUX tool, complementary to XML sitemap
RSS / Atom feedCan serve as a freshness sitemapBlog publishers wanting fast indexing
Most sites need just one standard XML sitemap. Image and video sitemaps add value for media-heavy publishers. News sitemaps are specialized and require approval.

Sitemap Index: When You Need Multiple Files

Google's per-file limits are 50,000 URLs and 50MB uncompressed. Sites that exceed either threshold need to split into multiple sitemap files, referenced by a single sitemap index.

A sitemap index looks like this:

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

Each referenced sitemap file follows the standard format. Common splits:

  • By type: pages.xml, blog.xml, products.xml, categories.xml
  • By date: sitemap-2026-05.xml, sitemap-2026-04.xml — helps with crawl freshness signals
  • By language: sitemap-en.xml, sitemap-es.xml, sitemap-de.xml
  • By section: sitemap-docs.xml, sitemap-help.xml, sitemap-changelog.xml

Image Sitemaps: Worth It for Visual Content

The standard XML sitemap can include image metadata using an extension namespace:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  <url>
    <loc>https://yoursite.com/products/red-sneaker.html</loc>
    <image:image>
      <image:loc>https://yoursite.com/images/red-sneaker.jpg</image:loc>
      <image:caption>Red running sneaker, side view</image:caption>
      <image:title>Red Performance Runner</image:title>
    </image:image>
  </url>
</urlset>

Most modern image sitemaps just include the <image:loc> tag — Google can extract image metadata from page context automatically. The image namespace mostly helps for images discovered via JavaScript or lazy-loading that crawlers might otherwise miss.

What URLs Should Be in Your Sitemap?

Include only the canonical, indexable URLs you want in search results.

  • Include: homepage, all blog posts, all product pages, all category pages, important landing pages, legal pages you want indexed.
  • Exclude: admin URLs, login pages, checkout flows, search result pages, paginated archive pages (or include only the first page), thank-you pages, URLs with tracking parameters, non-canonical duplicates.
  • Match canonical tags. If a page has <link rel="canonical" href="X">, the URL in the sitemap should be X, not the variant.
  • Match robots.txt. Don't include URLs that your robots.txt blocks — it confuses crawlers.
  • Match noindex. Pages with noindex tags shouldn't be in the sitemap — you're telling search engines "consider this" and "don't index this" simultaneously.
Consistency rule: a URL should appear in the sitemap if and only if you want search engines to index it. Mixed signals (sitemap says "consider me," noindex says "don't index") waste crawl budget and create reports full of confusion errors.

How Sitemaps Get Generated in 2026

  • CMS plugins. WordPress (Yoast, Rank Math, All-in-One SEO) auto-generates and updates sitemaps. Shopify generates one automatically. Webflow, Wix, Squarespace all do it natively.
  • Headless / static sites. Build-time generation via plugins (Next.js sitemap, Gatsby plugin-sitemap, Hugo built-in). Sitemap updates with each deploy.
  • Crawler-based generation. Tools like Screaming Frog crawl your site and output a sitemap of discovered URLs.
  • Manual / generator tools. For static sites, custom apps, or one-off needs, our free XML sitemap generator creates a valid sitemap from a list of URLs or by importing an existing sitemap.

For most sites, plugin-based generation handles everything automatically. Generator tools are useful for one-time builds, sitemap audits, and complex multi-section setups.

How Sitemaps Get to Search Engines

Three ways to make your sitemap discoverable:

  1. Reference it in robots.txt — add Sitemap: https://yoursite.com/sitemap.xml at the bottom of your robots.txt. All major crawlers respect this.
  2. Submit via Google Search Console — the gold-standard method. Search Console then reports on processing status, errors, and how many URLs were indexed.
  3. Submit via Bing Webmaster Tools — Bing's equivalent. Less impact than Google but still recommended for completeness.

For the full submission workflow, see our guide to submitting sitemaps to Google and Bing.

From the classroom

When a student finally gets sitemaps, it's almost always because one sentence clicked: "found" and "ranked" are two different jobs. I've watched people add a sitemap, refresh Search Console an hour later, and feel let down that nothing moved in the rankings. Nothing was supposed to move. The sitemap did its job the moment Google read the list and crawled the pages it didn't already know about. Rankings come later, from the content itself and the links pointing at it. So if you take one thing from this whole guide, take that: build the sitemap to be found, then go earn the ranking separately. They don't happen in the same step, and they never did.

Frequently Asked Questions

Search engines still find your pages through link discovery — they crawl your homepage and follow links. For small, well-linked sites this works fine. For large sites, sites with deep navigation, or sites with orphan pages, missing sitemap means slower discovery and some pages may never be indexed.

Not directly. Sitemaps aren't a ranking signal. They improve discovery and indexing — which expands the universe of pages that can rank. So indirectly, yes: more indexed pages means more ranking opportunities. But adding a sitemap to a 5-page site that's already fully indexed won't move the needle.

If image search is a meaningful traffic source (e-commerce, photography, recipes, design), yes — add image metadata. For most other sites, Google extracts image info from page context automatically, so explicit image sitemap entries add little.

No — any filename works. Common convention is sitemap.xml at the root, but search engines will use whatever URL you submit (or reference in robots.txt). For multi-file setups, sitemap_index.xml is the conventional name for the parent file.

Yes — search engines accept gzip-compressed sitemaps (filename like sitemap.xml.gz). The 50MB uncompressed limit still applies, but compression reduces transfer size meaningfully for sites with thousands of URLs. For most sites it's a micro-optimization, not a must.

A sitemap is a single file listing URLs. A sitemap index is a parent file that references multiple sitemap files. The index is used when a site exceeds 50,000 URLs in one file, or when you want to organize sitemaps by section (blog, products, etc.). Both are submitted to Google the same way.

If You Remember One Thing

A sitemap is how search engines find your pages, not how they rank them. Once that's clear, the rest is mechanical: the format is simple, the discovery benefit is real (especially on larger sites), and modern generators handle the fiddly parts (auto-priority, validation, 50k+ URL splitting) for you. Generate one in under a minute, submit it to Search Console, reference it in robots.txt, and then go spend your real energy on the content and links that actually move rankings.