Skip to main content
EnglishEN EspañolES FrançaisFR DeutschDE ItalianoIT PortuguêsPT 中文ZH 日本語JA 한국어KO РусскийRU NederlandsNL
← Back to all articles

XML Sitemaps Done Right: lastmod, Size Limits and Sitemap Index Files

Most small business websites have an XML sitemap, usually generated by a plugin or a CMS setting nobody has looked at since launch. Having one is easy. Having one that search engines actually trust and use is a different matter.

This guide covers what a sitemap is for and what it can't do, which URLs belong in it, how to set <lastmod> so Google and Bing believe it, why <priority> and <changefreq> are no longer worth your time, the size limits, and how sitemap index files work once you outgrow a single file. If you want to know where to submit the finished sitemap, see my separate guide on submitting it to every search engine.

Key facts

  • 50,000 — Maximum URLs in a single sitemap file (sitemaps.org, Google and Bing)
  • 50MB — Maximum uncompressed size of one sitemap file
  • 500 — Sitemap index files Google lets you submit per Search Console property
  • 0 — Weight Google gives to priority and changefreq: it ignores both

What a Sitemap Does (and Doesn't Do)

An XML sitemap is a file that lists the URLs on your site you want search engines to know about, optionally with the date each one last changed. The format is defined by the Sitemaps protocol, which Google, Bing and other engines share.

It helps crawlers find pages they might otherwise miss, such as new pages with few internal links, and tells them which pages changed recently. Bing's webmaster team described sitemaps in 2025 as a foundational signal for discovery, alongside IndexNow for real-time change notifications.

What a sitemap does not do:

  • It doesn't guarantee crawling or indexing. Google's documentation calls submitting a sitemap "merely a hint". Pages still need to be worth indexing.
  • It doesn't boost rankings. It is a discovery tool, not a ranking factor.
  • It doesn't replace internal links. Visitors and crawlers should still be able to reach every important page from your navigation and content.

Which URLs Belong in Your Sitemap

Google asks you to list the URLs you want to appear in search results, using the canonical version of each. In practice that means every URL in your sitemap should:

  • Return a 200 status. No redirects, no 404s, no server errors.
  • Be the canonical URL. If a page's rel="canonical" points somewhere else, list the target, not the duplicate. Mixed signals waste crawl time.
  • Be indexable. Don't list pages carrying noindex or pages blocked in robots.txt.
  • Be absolute and consistent. Google wants fully qualified URLs such as https://www.example.com/services/, not relative paths. Use the same protocol, host and trailing-slash style your site actually serves.

Leave out thank-you pages, internal search results, filtered or sorted versions of the same listing, login and cart pages, and tag archives you've chosen not to index. A sitemap of 40 strong, canonical pages is more useful than one padded with 400 thin ones.

Where the file lives

Google recommends putting the sitemap at the root of the site. Under the Sitemaps protocol, a sitemap only covers URLs in its own folder and below, so /blog/sitemap.xml can't list /services/ pages unless you submit it through Search Console. All URLs must be on the same host and protocol as the sitemap file.

Getting lastmod Right

<lastmod> is the one optional tag that still matters. It tells crawlers when a page last changed, so they can skip unchanged pages and revisit updated ones sooner.

The catch is trust. Google says it uses lastmod only if the value is "consistently and verifiably" accurate. Bing says much the same: when every URL carries the same date, usually because the sitemap generator stamped the current time on everything, Bing may disregard those dates. Its 2023 post on the subject named identical lastmod values as the most common error it sees.

Rules to follow:

  1. Use the page's real last significant change. Google counts changes to the main content, structured data or links as significant. Updating a copyright year or a sidebar widget is not.
  2. Never set lastmod to the time the sitemap was generated. The Sitemaps protocol says the value is the date the page was modified, not the date the sitemap was built.
  3. Use W3C Datetime format. A plain date (2026-11-20) is valid. A full timestamp with a time zone (2026-11-20T09:30:00-05:00) is better; Bing recommends including both date and time.
  4. Leave it out if you can't get it right. A missing lastmod is better than a wrong one that teaches search engines to ignore yours.

If you use WordPress or another CMS, check that the date in the sitemap tracks the post's modified date, then edit a page and confirm only that page's date changes.

Skip priority and changefreq

The Sitemaps protocol still defines <priority> (0.0 to 1.0) and <changefreq> (daily, weekly and so on), and many generators fill them in by default. Both major engines have said they don't use them:

  • Google's sitemap documentation states plainly that Google ignores <priority> and <changefreq> values.
  • Bing's 2025 guidance says these optional tags are ignored by Bing, and its 2023 post explained why: they are often set incorrectly or identically across a whole site.

You don't need to remove them, since they do no harm, but don't spend time tuning them. Put that effort into accurate lastmod dates instead.

Size Limits, Compression and Sitemap Index Files

One sitemap file may contain at most 50,000 URLs and be no larger than 50MB uncompressed. These limits come from the Sitemaps protocol and are repeated in Google's and Bing's documentation. You can gzip the file (sitemap.xml.gz) to save bandwidth, but the uncompressed size must still fit within 50MB.

Most small business sites never come close. When a site does outgrow one file, or when you simply want separate files for pages, posts and products, you use a sitemap index: a small file that lists other sitemaps.

<?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-11-20T09:30:00-05:00</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://www.example.com/sitemap-posts.xml</loc>
  </sitemap>
</sitemapindex>

Key points from Google and the protocol:

  • An index can list up to 50,000 sitemaps.
  • Each listed sitemap must be on the same site and in the same folder as the index or deeper.
  • The index's own <lastmod> is when that sitemap file changed, not when its pages did.
  • Google lets you submit up to 500 sitemap index files per Search Console property.

Splitting by content type has a practical bonus: Search Console reports on each sitemap separately, so you can see at a glance whether your service pages or your blog posts have indexing problems.

Formatting Details That Break Sitemaps

A sitemap that fails to parse is ignored. The usual culprits:

  • Encoding. The file must be UTF-8.
  • Unescaped characters. An ampersand in a URL must be written as &amp;. The protocol also lists escapes for quotes, apostrophes and angle brackets.
  • Overlong URLs. Each <loc> must start with the protocol and be under 2,048 characters.
  • Stray output. PHP warnings, a byte-order mark or whitespace before <?xml can break the file. Open the sitemap URL in a browser and check that it renders as XML.

XML isn't your only option. Google also accepts RSS 2.0 and Atom 1.0 feeds and plain text files with one URL per line, and Bing calls XML its preferred format. For most sites a standard XML sitemap is the simplest choice.

Tell Search Engines Where It Is, Then Check It

Add a line like this anywhere in your robots.txt file. Google and Bing both read it, and you can list more than one:

Sitemap: https://www.example.com/sitemap.xml

Then submit it in Google Search Console and Bing Webmaster Tools. Google retired its old anonymous sitemap "ping" endpoint after announcing the change in June 2023, so robots.txt and Search Console are now the ways to tell Google. For instant notice of individual changes, Bing and other engines support IndexNow.

A quick monthly check:

  1. Open the Sitemaps report in Search Console and confirm the status is Success with a recent read date.
  2. Compare the number of discovered URLs with the number of pages you expect.
  3. Spot-check five URLs from the file: each should return 200, be self-canonical and be indexable.
  4. Edit one page and confirm only its lastmod changes.

Sources

Related reading

Frequently asked questions

Does a small business website need an XML sitemap?

It isn't required, and a small, well-linked site can be crawled without one. But a sitemap is cheap to maintain and helps search engines find new and updated pages faster, so it's worth having as long as it lists only canonical, indexable URLs.

Should I set priority and changefreq in my sitemap?

There's no need. Google says it ignores both values and Bing says it ignores them too. Spend the effort on accurate lastmod dates instead.

When do I need a sitemap index file?

When one sitemap would exceed 50,000 URLs or 50MB uncompressed, or when you want separate sitemaps for pages, posts and products so you can monitor each in Search Console.

Want a sitemap search engines actually trust?

Tell me about your site and I'll send a free, no-obligation quote for a clean technical SEO setup, sitemap included.

Get a free quote