Technical

XML sitemaps: build, submit, and maintain

Quick answer

An XML sitemap lists the canonical URLs you want in search, so crawlers can find them. List only indexable pages, use absolute URLs, keep each file under 50,000 URLs or 50MB uncompressed, set an accurate lastmod, and submit the file in Search Console or reference it in robots.txt. It is a hint, not a guarantee.

Why it matters

Google says a sitemap helps search engines discover URLs, but does not guarantee that every listed item is crawled and indexed. It is most useful for large sites, new sites with few external links, and sites with a lot of media.

A sitemap also tells Google which URLs you prefer. Google says that when you build one you are telling search engines which URLs you want shown, which are your canonical URLs, so a sitemap full of redirects, duplicates, and blocked pages sends conflicting signals.

Key takeaways

  • Include only canonical URLs that return 200 and that you want indexed.
  • Google ignores priority and changefreq, and uses lastmod only when it is consistently and verifiably accurate.
  • Split anything over 50,000 URLs or 50MB uncompressed and list the files in a sitemap index.
  • Submitting a sitemap is a hint. Linking pages well from your site matters just as much.

Step by step

  1. Decide whether you need one

    Google says you might not need a sitemap if your site is small, about 500 pages or fewer, and comprehensively linked from the home page. You are more likely to need one if the site is large, new with few external links, or heavy on images and video. Most sites benefit from having one, and many CMS platforms already create it.

  2. Check whether your CMS already makes one

    Open /sitemap.xml or /sitemap_index.xml on your domain and see what loads. Many platforms generate this file automatically. If it exists, audit it rather than building another.

  3. List only the URLs you want in results

    Include canonical, indexable pages that return a 200 status. Exclude redirects, noindex pages, pages blocked by robots.txt, parameter duplicates, and error pages. Use absolute URLs, including the protocol and the exact host you use.

  4. Set lastmod honestly

    Google uses lastmod when it matches real changes, and says a significant update means main content, structured data, or links, not a changed copyright year. Update the date only when the page truly changed. Skip priority and changefreq, which Google ignores.

  5. Split large sites

    A single sitemap is capped at 50,000 URLs or 50MB uncompressed. Break larger lists into several files and publish a sitemap index. Splitting by section, such as services, guides, and locations, also lets you read indexing by group in Search Console.

  6. Submit and reference it

    Submit the file in the Sitemaps report in Search Console, which shows when Google read it and any errors. You can also add a Sitemap line to robots.txt with the full URL. Host the file at the site root, which Google recommends.

  7. Review after each release

    Open the Sitemaps report and compare submitted and indexed URLs. Investigate any URL that is in the sitemap but not indexed, using the Page indexing report. Remove pages you deleted, and add new ones if your system does not do it automatically.

A minimal XML sitemap

This is the smallest valid XML sitemap, with 2 fictional pages.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/services/boiler-repair</loc>
    <lastmod>2026-09-14</lastmod>
  </url>
  <url>
    <loc>https://example.com/guides/winter-heating-checklist</loc>
    <lastmod>2026-10-02</lastmod>
  </url>
</urlset>

Add the file to robots.txt with one line.

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

How Doily helps

Doily's site audit crawls your pages and ranks fixes by priority, so you can spot indexable pages that are missing from your sitemap and listed pages that redirect or return errors.

Questions

Will a sitemap make Google index my pages?

No. Google states that a sitemap helps discover URLs but does not guarantee that every item in it will be crawled and indexed.

Do I need an image sitemap?

Only if Google might not find your images otherwise, such as images reached through JavaScript. Google says you can use a separate image sitemap or add image tags to your existing sitemap, and both work equally well.

Where should the sitemap live?

At the site root. Google says a sitemap posted at the root can affect all files on the site, while one in a subfolder affects only that folder unless it is submitted through Search Console.

Sources

Primary sources, checked Oct 11, 2026.

Get found everywhere.

Doily opens to new workspaces soon.