Technical SEO
What is an XML sitemap and what goes in it?
An XML sitemap lists the URLs you want search engines to find. Learn what to include, how lastmod is used, the size limits and how to submit one.
What a sitemap does
An XML sitemap is a file that lists the URLs on your site you want search engines to crawl and index, with optional details such as when each page last changed. It follows the sitemaps.org protocol, which Google, Bing and other search engines support.
It helps discovery, especially on large sites, new sites with few external links, and sites that publish often. It is a hint, not a command: listing a URL does not guarantee it will be crawled or indexed. A small site with good internal links may be found without one, but a clean sitemap costs little and gives you a useful reference point in Search Console.
What to include and what to leave out
Include only the URLs you want to appear in search: canonical, indexable pages that return a 200 status. A sitemap full of redirects, errors or duplicates sends mixed signals and makes your indexing reports harder to read.
- Leave out URLs that redirect, return 404 or 410, or carry noindex.
- Leave out non-canonical variants, such as parameter, sorting or session URLs.
- Leave out URLs blocked by robots.txt, and staging or test pages.
- Use full, absolute URLs with the same protocol and hostname as your canonicals.
The tags that matter
Each entry needs a loc element with the URL. The optional lastmod element gives the date the page last changed in a meaningful way. Google uses lastmod when it is consistently and verifiably accurate, so update it for real changes to content, structured data or links, not for a new copyright year or every rebuild of the site. Google ignores the priority and changefreq values.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/services/roof-repair/</loc>
<lastmod>2026-09-14</lastmod>
</url>
</urlset>Size limits and sitemap index files
A single sitemap can hold up to 50,000 URLs or 50 MB uncompressed, whichever comes first. You can gzip the file to save bandwidth, but the uncompressed limit still applies.
For larger sites, split URLs across several sitemaps and list them in a sitemap index file. Splitting by section or content type, such as products, categories and articles, also makes it easier to see which part of the site has indexing problems.
Submitting and referencing it
- Submit the sitemap URL in the Sitemaps report in Google Search Console, and in Bing Webmaster Tools.
- Add a Sitemap line with the full URL to your robots.txt file, so any crawler that reads robots.txt can find it.
- Check the Sitemaps report for fetch or parsing errors, then use the Page indexing report to see which submitted URLs were indexed and why others were not.
- Regenerate the sitemap automatically when pages are added, removed or changed.
Sitemap: https://www.example.com/sitemap.xmlGoogle retired its sitemap ping endpoint in 2023. Submitting in Search Console, referencing the file in robots.txt and keeping lastmod accurate are now the ways to signal changes.
Put it to work
- Free auditCheck your homepage in about a minute and see a preliminary score with your top issues.
- MovesDrafted fixes with a projected score impact. You approve, the connector applies.
- Connect Search Console, Analytics 4 and Google Business ProfileWhat each Google connection adds to Nalza, and what Nalza does with the access.
More in Technical SEO
- What are Core Web Vitals?Core Web Vitals measure loading, responsiveness and visual stability. Learn the LCP, INP and CLS thresholds, how they are measured and how to fix them.
- What is structured data and schema markup?Structured data describes a page's content in a format machines can read. Learn JSON-LD, the common schema types, rich results and how to test markup.
- What is a canonical tag?A canonical tag tells search engines which URL is the main version of duplicate pages. Learn how it works, how to set it and which mistakes to avoid.
- Can crawlers see content rendered by JavaScript?Googlebot renders JavaScript, but many AI crawlers appear to read only the raw HTML. Learn how rendering works and how to keep key content visible to both.
- Which redirect should you use: 301, 302, 307 or 308?Permanent and temporary redirects send different signals. Learn when to use 301, 302, 307 and 308, and how to avoid chains, loops and migration mistakes.
- How to control crawling, indexing and snippetsRobots.txt controls crawling, noindex controls indexing and canonicals consolidate duplicates. Learn what each one does and when to use which.
- How to write title tags and meta descriptionsTitles and meta descriptions shape how a page appears in search results. Learn how to write them, why Google rewrites them and how long they should be.