Search 4 min read Updated
XML sitemaps that help search engines
In short
An XML sitemap helps search engines find the pages you want considered, within the protocol limits of 50,000 URLs and 50 MB per file.
A sitemap helps most on large sites, on new sites with few external links, and on sites with many media files. An XML sitemap is the list of URLs you want search engines to find and consider. Before you write one by hand, check whether your platform already generates it, and keep to the protocol’s limits.
A sitemap is a list, not a guarantee of indexing
Google describes a sitemap as a file that gives search engines information about the pages, videos and other files on your site, including when a page was last updated. The overview is at Sitemaps overview. A sitemap does not guarantee that every listed URL will be crawled and indexed.
Google says a sitemap helps most on large sites, on new sites with few external links and on sites with many video, image or news items. A site of about 500 pages or fewer that is comprehensively linked may not need one. Many content management systems create a sitemap automatically, so check your platform first.
A sitemap works best as a list of the pages you want search engines to consider, not as a dump of every URL your system can generate. Leave out faceted filters, internal search results and pages that are blocked or redirected, because they dilute the list.
Limits and format
| Item | Limit or rule |
|---|---|
| URLs per file | No more than 50,000 |
| Size of one file, uncompressed | No more than 50 MB |
| Required tags | urlset, url and loc |
| Encoding | UTF-8, with data values entity-escaped, for example an ampersand written as & |
The loc value must include the protocol, such as https, and stay under 2,048 characters. The limits and tag definitions are in the sitemaps.org protocol. Count the URLs when you generate the file, and split it before the limit is reached, not after a crawl reports an error.
Working on something similar in your own product? A few honest sentences are enough – we read every enquiry and reply by email. Apply with your idea
Set lastmod honestly and ignore priority and changefreq
The lastmod tag should reflect the date and time of the last significant update to the page, not the date the sitemap was generated. Google uses lastmod when it is consistently and verifiably accurate, so a value that changes on every build does not help.
Google ignores the priority and changefreq values, so time spent setting them brings no search benefit. The protocol describes changefreq as a hint, not a command, and priority compares pages only within your own site.
Point search engines at the file
Add a line that begins with Sitemap: and gives the full URL of the file, anywhere in robots.txt. You can also submit the sitemap in Search Console. Google’s step-by-step guide is Build and submit a sitemap.
After you submit, read the sitemap reports in Search Console. Fix errors such as unreadable files or URLs that cannot be fetched in the source data, not by editing the file by hand.
Keep the sitemap generator in the same release pipeline as the site, so that each change to the list is traceable.
Do not confuse the sitemap with blocking. A sitemap lists the pages you want found; what blocking crawling and blocking indexing each do is explained in robots.txt and noindex are different controls.
A checklist for your sitemap
- Include only the canonical addresses that return a normal page, not redirects or pages marked noindex.
- Split the list into several files before any file reaches 50,000 URLs or 50 MB.
- Set lastmod only when the page changes in a meaningful way.
- Escape ampersands and other special characters, and save the file as UTF-8.
- Check the file after each release, and fix any errors that Search Console reports.
Common questions
- Does a small site need a sitemap?
- Google says a site of about 500 pages or fewer that is comprehensively linked may not need one. Check your internal links before you decide.
- Does a sitemap guarantee indexing?
- No. Google states that a sitemap does not guarantee that every listed item will be crawled and indexed.
- Should I set priority and changefreq?
- Google ignores both values. Keep lastmod accurate instead, because Google uses it when it is consistently and verifiably accurate.
Sources
- What Is a Sitemap, Google Search Central. Accessed 24 November 2026
- Build and submit a sitemap, Google Search Central. Accessed 24 November 2026
- Sitemaps XML format, sitemaps.org. Accessed 24 November 2026
Further reading
-
robots.txt and noindex are different controls
robots.txt decides which URLs crawlers may fetch, while noindex decides whether a fetched page may appear in search results.
-
Canonical URLs when one page has many addresses
A canonical URL is the address you want search engines to treat as the main version, and you signal it with redirects, rel=canonical and your sitemap.
-
Moving a site without losing search traffic
Map every important old URL to its new equivalent, redirect it permanently, then update links and sitemaps and watch the results for weeks.
Have an idea that should exist? Or a working product that needs more customers, a new website or a complete rework? Bring us anything. Apply with your idea