Skip to content

AI visibility guide

Sitemap Best Practices:
How to Keep sitemap.xml Fresh

Sitemap best practices in short: size limits, accurate lastmod, canonical URLs only, and a Sitemap line in robots.txt. With how we run ours.

~15 min · Updated October 15, 2026

Crawlability

The best practices for a sitemap come down to five rules: list only canonical, indexable URLs; use absolute URLs; keep each file under 50 MB or 50,000 URLs and split bigger sites with a sitemap index; set lastmod only when the page really changed; and reference the sitemap in robots.txt. Google also says it ignores the priority and changefreq values, so do not spend time tuning them.

Freshness is the part most sites get wrong. Google uses lastmod only when it is consistently and verifiably accurate, so a date that updates on every deploy teaches crawlers to ignore it. Ours is an index of five child sitemaps (marketing, guides, glossary, blog, programmatic pages) holding 303 URLs in total on 15.10.2026, and the dates inside them differ per URL: the blog file, for instance, carries dates from July to October rather than one stamp for everything.

Why it matters for AEO. Googlebot and Bing use your sitemap to discover pages. A stale sitemap (missing new pages, listing 404s) or duplicate canonical URLs wastes crawl attention and sends mixed signals about which URL you want indexed.

How to do it

  1. Confirm /sitemap.xml exists, returns a 200 status, and is referenced in robots.txt.
  2. Make sure it auto-regenerates on publish (most frameworks and CMSs do this by default) rather than being a stale, manually maintained file.
  3. Add a self-referencing <link rel="canonical"> tag on every page, especially ones reachable via multiple URLs (with or without a trailing slash, tracking params, http vs https).
  4. Remove or return 410 for old pages instead of leaving thin, outdated duplicates live in the sitemap.

How to verify. Open sitemap.xml, spot-check 5 URLs for a 200 status, and confirm the canonical tag on each matches the URL you actually want indexed.

Example

<link rel="canonical" href="https://yourdomain.com/pricing" />

Your AI visibility dashboard

Two people in a dark meeting room looking at the AskAiRank dashboard on a wall screen

Put it into practice

See how your SaaS shows up across ChatGPT, Claude, and Perplexity.

FAQ

Frequently asked questions

Quick answers about sitemap best practices: how to keep sitemap.xml fresh.

What happens if my sitemap or canonical URLs get out of sync?

A stale sitemap or duplicate canonical URLs send mixed signals about which URL you want indexed, splitting attention across near-duplicate URLs.

How often should the sitemap update?

Automatically, on publish - not on a manual monthly schedule. Any new or updated page should appear in the sitemap the same day it goes live.

How do I check canonical consistency?

Crawl your own site (e.g. with Screaming Frog) and confirm every indexable URL's canonical tag points to itself or to one clearly intended target, with no conflicting duplicates.

Founder working late at three monitors

Track your AI visibility

See how your SaaS appears in ChatGPT, Claude, and Perplexity.

3-day trial, no card: 10 prompts on ChatGPT and DeepSeek, checked daily.