March 5, 2026·5 min read·By NitroSERP Editorial Team
Updated
XML Sitemap Best Practices: Limits & lastmod (2026)
Build a valid XML sitemap with canonical URLs, accurate lastmod dates, sitemap indexes, and fixes for common Google Search Console indexing gaps.
An XML sitemap (sitemap.xml) is a machine-readable file following the sitemaps.org 0.9 protocol that lists a website's canonical, indexable URLs alongside optional <lastmod> timestamps so search engine crawlers (Googlebot, Bingbot) and AI search bots can discover new and updated pages efficiently.
To build a clean sitemap.xml file for your site right now, paste your canonical URLs into our free XML sitemap generator.
2026 XML Sitemap Protocol Specifications & Google Support
Not every tag in the XML sitemap specification is used by Google today. Here is how modern search crawlers process each element:
| XML Tag / Limit | Protocol Rule | Google Support (2026) | Best Practice |
|---|---|---|---|
| Max URLs per Sitemap | 50,000 <url> entries max per file | Enforced strictly | Split larger inventories using a <sitemapindex> file |
| Max Uncompressed Size | 50 MB (52,428,800 bytes) max | Enforced strictly | Compress large sitemaps with gzip (sitemap.xml.gz) |
<loc> | Full, absolute UTF-8 escaped URL | Required & Used | Must match exact canonical (https://, www vs non-www, trailing slash) |
<lastmod> | W3C Datetime (YYYY-MM-DD or ISO 8601) | Used for Recrawl Scheduling | Only update when page content or structured data materially changes |
<changefreq> | daily, weekly, monthly, etc. | Ignored by Googlebot | Safe to omit or leave as a static hint |
<priority> | 0.0 to 1.0 relative score | Ignored by Googlebot | Setting every page to 1.0 has zero effect on crawl priority |
Copy-and-Paste Valid sitemap.xml & sitemap_index.xml Examples
1. Standard Single sitemap.xml (Under 50,000 URLs)
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.nitroserp.com/</loc>
<lastmod>2026-10-22</lastmod>
</url>
<url>
<loc>https://www.nitroserp.com/tools/xml-sitemap-generator</loc>
<lastmod>2026-10-22</lastmod>
</url>
<url>
<loc>https://www.nitroserp.com/blog/xml-sitemap-best-practices-2026</loc>
<lastmod>2026-10-22</lastmod>
</url>
</urlset>
2. Sitemap Index File (For Sites with Multiple Content Types or >50,000 URLs)
Even if your site has fewer than 50,000 URLs, splitting your sitemaps by page type (sitemap-tools.xml, sitemap-blog.xml, sitemap-categories.xml) makes it easy to filter Google Search Console → Page Indexing reports by section:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/sitemap-pages.xml</loc>
<lastmod>2026-10-22</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap-blog.xml</loc>
<lastmod>2026-10-22</lastmod>
</sitemap>
</sitemapindex>
The "Dirty Sitemap" Anti-Patterns: What to Never Put in sitemap.xml
Including non-canonical or error URLs in your sitemap wastes crawl budget and triggers warnings in Google Search Console. Audit your sitemap and remove:
301or302Redirecting URLs: If/old-slugredirects to/new-slug, remove/old-slugfrom the sitemap and list only/new-slug.404 Not Foundor410 GoneURLs: Remove dead URLs and list only live, canonical URLs that return200 OK. Error URLs waste crawl requests and can produce sitemap or indexing warnings in Search Console.noindexPages: Never include a URL insitemap.xmlif it has<meta name="robots" content="noindex" />. Sending "please discover this URL" (sitemap) and "do not index this URL" (noindex) simultaneously creates a Search Console coverage conflict.- URLs Blocked by
robots.txt: Verify that no sitemap URL matches aDisallow:rule in yourrobots.txt(check with our robots.txt generator). - Parameterized / Non-Canonical Duplicates: Exclude
?utm_source=,?sort=, and?page=variants unless they are intentionally self-canonicalized indexable pages. Confirm canonical alignment with our canonical URL generator.
Why Pages in Your Sitemap Still Show "Discovered – Currently Not Indexed"
Submitting a valid sitemap.xml ensures discovery, not indexation. When Google Search Console reports URLs as "Discovered – currently not indexed" or "Crawled – currently not indexed", it means Google knows the URL exists from your sitemap, but paused indexing for one of three reasons:
- Orphan URLs (Zero Internal Links): If a page appears in
sitemap.xmlbut has zero internal<a href>links pointing to it from your homepage, category hubs, or blog posts, Google treats it as low-priority. Audit your page's outgoing links with our anchor text extractor. - Thin or Boilerplate Content: A short page is not automatically a problem, but generic copy that adds little beyond other pages may not be selected for indexing. Give each tool or post a distinct purpose, specific instructions, examples, and genuinely useful supporting content.
- Fake
<lastmod>Timestamps: If your build pipeline sets<lastmod>to today's date on every deploy even for pages that haven't changed in months, Google stops trusting your<lastmod>signal completely. Only emit or update<lastmod>when the page's visible content actually changes.
Step-by-Step Sitemap Deployment Checklist
- Generate your XML: Paste your canonical URLs into the free XML sitemap generator and download
sitemap.xml. - Host at the domain root: Upload the file to
https://www.yourdomain.com/sitemap.xmland verify it returnsHTTP 200withContent-Type: application/xml. - Declare in
robots.txt: AddSitemap: https://www.yourdomain.com/sitemap.xmlat the bottom of yourrobots.txtfile using the robots.txt generator (see our robots.txt beginner's guide). - Submit in Google Search Console & Bing Webmaster Tools: Paste the sitemap path under Indexing → Sitemaps and monitor the Indexed vs. Not Indexed ratio every 14 days.
Related SEO Guides
- Hreflang Tags: 2026 Setup, ISO Codes & x-default GuideImplement hreflang correctly with reciprocal return links, valid language and region codes, self-referencing canonicals, and x-default examples.
- UTM Parameters: GA4 Naming Rules & Examples (2026)Learn how utm_source, utm_medium, utm_campaign, utm_term, and utm_content work in GA4, with naming rules, channel mapping, and SEO tips.
- Robots.txt Guide: Examples, Rules, and Indexing ChecksLearn robots.txt with practical Allow and Disallow examples, sitemap rules, and a checklist for diagnosing crawling versus indexing problems.