🗺️XML Sitemap Best Practices

How to create and maintain an XML sitemap that maximizes crawl efficiency — what to include, what to exclude, sitemap index files, and how to submit it to Google.

Hugo Team·September 2, 2026
xml sitemapsitemapcrawl budgetindexinggoogle search consoletechnical seo

A well-maintained XML sitemap is the most direct way to tell Google which pages exist on your site. It's especially critical for large sites (1000+ pages), new sites without many backlinks, and sites with complex URL structures where Googlebot might not discover all content through crawling alone.

What to Include

  • All canonical, indexable URLs — pages you want Google to find and rank.
  • Use absolute URLs (https://example.com/page, not /page).
  • Include the <lastmod> element with accurate dates — updated whenever content changes significantly.
  • Use <changefreq> and <priority> sparingly — Google largely ignores them, but they add some signal.

What to Exclude

  • Pages with noindex meta tag (never include — contradictory signals)
  • Redirect URLs (301/302 destinations should be in the sitemap, not the source)
  • Paginated pages beyond page 1 (unless they have unique content)
  • Login, checkout, account, and admin pages
  • Duplicate content URLs (only include the canonical version)
  • Soft 404 pages and thin content pages

Sitemap Index Files

A single sitemap file has a 50,000 URL limit and a 50 MB uncompressed size limit. For larger sites, create a sitemap index file — a sitemap of sitemaps. The index file lists individual sitemap files, each covering a different content type (blog posts, products, images, videos).

xml
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-posts.xml</loc>
    <lastmod>2026-09-01</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-products.xml</loc>
    <lastmod>2026-09-01</lastmod>
  </sitemap>
</sitemapindex>
💡Lastmod Accuracy Matters

The <lastmod> date is one of Google's strongest freshness signals. Only update it when meaningful content changes — not cosmetic changes. Constantly updating lastmod to today's date (without real changes) trains Google to distrust your dates.

Submitting and Monitoring

Submit your sitemap in Google Search Console → Sitemaps → Enter URL → Submit. Monitor the Submitted vs Indexed count — a large gap (submitted 500, indexed 200) means Google is excluding many pages. Investigate Coverage errors to understand why.

References

  1. [1]Google: Build and submit a sitemap — Official guide to creating XML sitemaps — developers.google.com
  2. [2]sitemaps.org — The official Sitemap protocol specification — sitemaps.org

Your privacy matters

Hugo stores authentication tokens and your consent record. With your permission we may also show personalised ads via Google AdSense. ·