What is an XML sitemap?

Let's start from the beginning.

An XML sitemap is a file listing the URLs on your site that you want Googlebot and friends to crawl. This is what one looks like raw:

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

A sitemap doesn't replace internal linking. It gives Google a shortcut to discover new pages and spot the ones that changed since its last visit.

Do I need one?

It depends on the size of your site.

If you have 20 well-linked pages, Google will find them anyway. I'd still have one, because Search Console uses it to tell you how many of those URLs are indexed.

Where it does make a difference:

  • Sites with thousands of pages or that grow every day: ecommerce, publishers, directories, programmatic SEO…
  • Freshly published pages or pages with few internal links.
  • Migrations, when you want Google to find the new URLs as soon as possible.
  • CMSs that don't generate a sitemap, or fill it with URLs you don't want indexed.

How does the generator work?

This tool used to live at sitemapgenerator.xyz. I moved it to my site and rebuilt it so everything happens in your browser, which means your URLs don't go through any server.

Three steps:

  1. Get your URLs. The quickest way is to run Screaming Frog, filter by indexable and export. A CMS export or a database query works too.
  2. Paste them or upload the file. If there aren't many (up to about 10,000), paste them in the box. If there are more, upload a .txt with one URL per line or the crawler's .csv as is: the generator finds the URL column and ignores the rest.
  3. Hit generate and download. One sitemap means you get the .xml. Several, and you get them in a ZIP.

Along the way it removes duplicates, escapes special characters and shows you the lines it skipped. The escaping part matters: a single unescaped & breaks the whole sitemap and Search Console flags it as an error.

What if I have more than 50,000 URLs?

Each sitemap takes up to 50,000 URLs and 50 MB uncompressed. Go over either limit and the generator splits the list and creates an index pointing to every chunk.

Say you have a million URLs. You'll get this:

sitemap-index.xml
sitemap-1.xml
sitemap-2.xml
...
sitemap-20.xml

The index points to each sitemap at your domain root (https://yourdomain.com/sitemap-1.xml), so upload every file there. Then submit only the index to Search Console and Google takes care of the rest.

What if I work with several domains?

A sitemap can only hold URLs from its own host, so the generator groups them by domain without you touching anything.

Mix URLs from example.com and example.es and the ZIP looks like this:

example.com/
  sitemap-index.xml
  sitemap-1.xml
  sitemap-2.xml
example.es/
  sitemap.xml

What if I want to merge subdomains?

You can. Open the advanced settings and change the grouping RegExp, which defaults to .* (one group per host).

If you have www.example.com, m.example.com and blog.example.com and want them in the same sitemap, swap .* for example\..*.

Heads up: Google only accepts URLs from other hosts in a sitemap if you've verified all of them in Search Console or reference the sitemap from each host's robots.txt.

How do I submit it to Google?

Once you've downloaded it, four steps left:

  1. Upload the file to your root: https://yourdomain.com/sitemap.xml.
  2. Add this line to your robots.txt: Sitemap: https://yourdomain.com/sitemap.xml
  3. In Search Console, go to Indexing › Sitemaps, paste the URL and hit Submit.
  4. Do the same in Bing Webmaster Tools, which also feeds Copilot and DuckDuckGo.

A few days later the Sitemaps report tells you how many URLs Google discovered and how many it indexed. If the gap is wide, you know where your next audit starts.

Which URLs go in the sitemap?

Only the ones you want to see in Google. That means URLs that:

  • Return a 200, no redirects.
  • Are canonical, without tracking parameters or duplicate versions.
  • Have no noindex and aren't blocked by robots.txt.

Every broken or redirected URL you add tells Google your sitemap isn't reliable, and over time it pays less attention to it. That's why I'd run the crawler first and keep only the indexable pages.

What about lastmod, priority and changefreq?

Google ignores priority and changefreq, so the generator doesn't even add them.

lastmod is a different story. Google does use it, but only when the date reflects a real content change. Stamp today's date on pages that haven't changed in months and it learns to ignore it on your site.

My advice: tick the option only if every URL in your list changed today. Otherwise, let your CMS set the dates page by page.

And that's it. If you found it useful, share it with whoever is fighting with sitemaps right now 🙂