A sitemap is an XML file at a known location (typically /sitemap.xml) that lists URLs on your site for search-engine crawlers. The tool above generates sitemap.xml content from input URLs; nothing leaves your machine.
The minimum sitemap
<?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/about</loc>
</url>
<url>
<loc>https://example.com/contact</loc>
</url>
</urlset>
That’s it. A list of <url> elements, each with a <loc> (the URL). Search engines will crawl these.
Optional metadata per URL
<url>
<loc>https://example.com/blog/post-1</loc>
<lastmod>2026-04-30</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<lastmod>— last-modified date in YYYY-MM-DD or full ISO 8601 form. Helps crawlers decide whether to re-fetch.<changefreq>— hint about update frequency. Values:always,hourly,daily,weekly,monthly,yearly,never. Google ignores this.<priority>— relative importance, 0.0 to 1.0. Google ignores this too.
For Google specifically, only <loc> and <lastmod> matter, and Google uses <lastmod> only if it’s consistently and verifiably accurate. The tool above can stamp today’s date on every URL — leave that off unless every page really changed today — and adds <changefreq> and <priority> only if you pick values. It rejects relative URLs, because <loc> must be a full URL.
Sitemap size limits
A single sitemap file can contain up to:
- 50,000 URLs
- 50 MB uncompressed (or
.xml.gzcompressed)
For larger sites, split into multiple sitemaps and link them via a sitemap index:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2026-04-30</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-blog.xml</loc>
<lastmod>2026-04-30</lastmod>
</sitemap>
</sitemapindex>
The index file points at sub-sitemaps; each sub-sitemap contains URLs.
Where to put the sitemap
Two ways to make crawlers find it:
- Submit it in Google Search Console and Bing Webmaster Tools. This also shows you when it was fetched and any errors.
Sitemap:directive in robots.txt. Works for any sitemap location and for every crawler that reads robots.txt:
Sitemap: https://example.com/sitemap.xml
Put the file at the site root (/sitemap.xml): Google notes that a sitemap only covers URLs below its own directory unless you submit it in Search Console.
What URLs to include
- Canonical URLs only. Don’t include both
https://example.com/pageandhttps://example.com/page/. Pick one and stick with it. - Public URLs only. Don’t include URLs that require authentication or are blocked by robots.txt — that confuses search engines.
- Successful URLs only. Don’t include URLs that return 404 or redirect. Maintain the sitemap as the site changes.
- Don’t include image URLs separately unless using a Google Images sitemap — they go inside the parent page’s
<url>element.
Image and video sitemaps
For media-rich sites, augment <url> elements with image or video metadata:
<url>
<loc>https://example.com/post-1</loc>
<image:image xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<image:loc>https://example.com/img/post-1-hero.jpg</image:loc>
</image:image>
</url>
Helps Google Images discover your images. Google deprecated the <image:caption>, <image:title>, <image:geo_location> and <image:license> tags in 2022; <image:loc> is the one that matters. Most sites don’t bother; for image-heavy sites, it’s worth it.
When to update the sitemap
- When you publish new content. Static-site generators (Hugo, Astro, Eleventy) typically regenerate the sitemap on each build.
- When you remove or redirect content. Stale sitemap entries make crawlers waste time on dead URLs.
- Periodically as a sanity check. A monthly review catches missing pages.
For dynamic sites, regenerate on a schedule or on every content change. For static sites, the sitemap is part of the build output.
Notifying search engines
After updating a sitemap, you can ping search engines:
- Google: Use Google Search Console to submit. The legacy
https://www.google.com/ping?sitemap=URLwas deprecated in 2023. - Bing: Use Bing Webmaster Tools or the IndexNow protocol.
- Yandex: Yandex Webmaster.
For frequently-updated sites, IndexNow is the fastest mechanism — it’s a single HTTP POST that notifies Bing and Yandex about specific URL changes.
Common pitfalls
- Including non-canonical URLs.
https://example.com/pageandhttps://example.com/page?utm=...should not both be in the sitemap. Use canonical URLs only. - Stale
<lastmod>dates. A<lastmod>from 2019 in a 2026 sitemap signals the sitemap itself is unmaintained; crawlers may discount it. - Linking to redirected URLs. Causes wasted crawl. Update the sitemap when you change URLs.
- HTTP URLs in an HTTPS site (or vice versa). Inconsistent protocol fragmentation. Pick one canonical form.
- Sitemaps larger than the limit. 50,000 URLs / 50 MB. Split with a sitemap index.
- Forgetting to declare the namespace. The
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"is required. - Wrong character encoding. UTF-8 is the standard. Other encodings may work but cause edge-case bugs.
For related crawler-facing files, see robots.txt generator, meta tag generator.