ratemysite.ai

How to create an XML sitemap with lastmod dates

An XML sitemap lists the canonical URLs you want indexed, with lastmod dates that show when each page last changed. It helps crawlers find new pages and refresh old ones faster. Generate it automatically, reference it in robots.txt, and submit it in Search Console.

By . Updated .

How do you fix it?

  1. Generate sitemap.xml with your CMS, framework or an SEO plugin, so it updates itself when pages change.
  2. Include only canonical, indexable 200 pages, and add an accurate <lastmod> date to each URL.
  3. Add the line "Sitemap: https://yourdomain/sitemap.xml" to robots.txt.
  4. Submit the sitemap URL in Google Search Console and Bing Webmaster Tools.
  5. Re-run the audit and confirm the Sitemap check passes.

What is an XML sitemap?

An XML sitemap is a machine readable file that lists the pages of a site along with optional details such as the last modified date. Crawlers use it as a checklist to discover pages that internal links may miss and to decide which pages to re-fetch. It does not guarantee indexing, but sites with a clean sitemap tend to see new pages crawled in hours or days rather than weeks.

What should I keep out of the sitemap?

List only URLs you would be happy to see in search results. Leave out redirected addresses, pages marked noindex, pages blocked by robots.txt and duplicate parameter URLs. A sitemap full of errors teaches crawlers to distrust it. Keep the format simple: one loc element and one lastmod element per URL, in W3C date format such as 2026-11-07. Check the file once a month, or after any large content change. A quick test is to open it in a browser, confirm it loads with a 200 status, and spot check five URLs to see that each one returns the page and not an error.

How much does this check matter?

What else do people ask?

How many URLs can one sitemap hold?
Up to 50,000 URLs or 50 MB uncompressed. Larger sites split into several files listed in a sitemap index.
Should lastmod change on every deploy?
No. Update it only when the page content really changes. Google ignores lastmod values it finds unreliable.

Sources