Skip to content

How to build sitemaps that work

Serve one sitemap per language at a stable URL, list absolute URLs only, include <lastmod>, submit it in Search Console, and split above 50k URLs.

Sitemaps that crawlers love

  1. Absolute URLs only

    <loc>https://example.com/page/</loc>, not <loc>/page/</loc>. Relative URLs are silently ignored.

  2. Include `<lastmod>`

    An accurate <lastmod> tells the crawler which pages changed. Do not update it when nothing changed.

  3. Split above 50,000 URLs

    Use a sitemapindex. Each child sitemap stays under 50k URLs and 50 MB.

  4. One sitemap per language

    /sitemaps/sitemap-en.xml, /sitemaps/sitemap-es.xml, with <xhtml:link> alternates in each.

  5. Submit in Search Console

    The "Sitemaps" report in Search Console is the only real health check. Check it after every deploy.