SEO
XML Sitemaps: Do You Need One and What to Include
Key takeaways
- A sitemap is a discovery hint; Google says it does not guarantee crawling or indexing.
- Sites of about 500 pages or fewer with good internal linking may not need one, per Google.
- Google ignores priority and changefreq, and uses lastmod only when it is consistently and verifiably accurate.
- One sitemap is limited to 50,000 URLs or 50MB uncompressed; use a sitemap index beyond that.
- Reference the sitemap in robots.txt so any compliant crawler can find it.
Do you need an XML sitemap?
A sitemap is a file that lists the URLs you want search engines to discover, and it helps most on large or new sites. According to Google Search Central, it is only a hint: submitting one does not guarantee that every listed URL will be crawled or indexed. For a small, well-linked site, it may add little.
Google's sitemap overview says that if your pages are properly linked, Google can usually find most of your site without one. It describes a small site as roughly 500 pages or fewer (counting only pages you want in search results) and notes that comprehensive internal linking reduces the need. Google also says sitemaps can help in three situations: large sites where keeping every page linked becomes hard, new sites with few external links pointing to them, and sites with video, image, or news content where a sitemap can carry extra detail. Even so, Google adds that most sites benefit from having one, and many content management systems already generate it.
What does a sitemap file actually contain?
The sitemaps.org protocol, which Google and other engines follow, wraps the file in a urlset element. Each page is a url entry with a required loc child holding the full address, including protocol. The protocol also defines optional lastmod, changefreq, and priority tags, and says support for optional tags varies by search engine.
Google also accepts RSS, mRSS, Atom 1.0, and plain text files with one URL per line, and says it has no preference among formats. The file must be UTF-8 encoded, and Google asks for fully qualified, absolute URLs rather than relative paths. The protocol adds that special characters such as ampersands must be entity-escaped.
Which optional tags matter?
Only lastmod is worth your attention. Google states that it ignores both priority and changefreq. The sitemaps.org protocol itself describes those values as hints rather than commands, and says priority only ranks pages within your own site.
For lastmod, Google says it uses the value only if it is consistently and verifiably accurate, for example when it matches the page's real last modification. Google describes a significant update as changes to the main content, structured data, or links, and says a copyright-date change does not count. In practice, this suggests that stamping every URL with the build or current date, regardless of whether it changed, risks teaching the crawler to ignore the field. That inference is ours; Google's documentation states the accuracy condition rather than describing a penalty.
What are the size limits and rules about location?
Google states that a single sitemap in any supported format is limited to 50MB uncompressed or 50,000 URLs. The sitemaps.org protocol agrees, allows gzip compression, and lets you list up to 50,000 sitemaps in a sitemap index file when you need more room.
On location, Google recommends posting the sitemap at your site root. Without a Search Console submission, Google says a sitemap affects only descendants of its parent directory. The protocol adds that a sitemap may only include URLs sharing its protocol, host, and path prefix or lying beneath it.
How should you submit it?
The protocol lists three routes: add a Sitemap line with the full URL to robots.txt, use a search engine's submission interface (which also provides status and error reports), or send an HTTP ping where an engine supports it. The protocol notes that a 200 response only confirms receipt, not that the file is valid. Listing the sitemap in robots.txt is the lowest-effort option because any compliant crawler can read it.
What should you leave out?
The protocol states that sitemaps indicate what you want indexed, and that pages you want kept out of results should be handled with robots.txt or a robots meta tag instead. A sensible approach is to list only the canonical, indexable URLs you actually want found. This is a practical recommendation rather than a quoted rule.
What is the bottom line?
Treat a sitemap as inexpensive insurance for discovery, not a ranking lever. Keep it accurate, keep lastmod honest, reference it in robots.txt, and remember that Google makes no promise to crawl or index everything in it. Documentation changes over time, so confirm details in the sources below before relying on them.
Frequently asked questions
Does a sitemap improve my rankings?
The sources reviewed describe sitemaps as a discovery aid, not a ranking factor. Google says a sitemap does not guarantee that listed URLs will be crawled or indexed.
Does Google use priority and changefreq?
No. Google's documentation states that it ignores both values. The sitemaps.org protocol describes them as hints that engines may or may not use.
How many URLs can one sitemap hold?
Up to 50,000 URLs or 50MB uncompressed, whichever limit you reach first. Larger sites split the list across several files and tie them together with a sitemap index.
Should I put the lastmod date as today on every page?
Google says it uses lastmod only when it is consistently and verifiably accurate, so the date should match real, significant changes to the page.
Sources
- Build and submit a sitemap — Google Search Central
- Learn about sitemaps (overview) — Google Search Central
- Sitemaps XML format (protocol) — sitemaps.org
Keep reading
See how AIrecommend.ai helps businesses get found and recommended by AI assistants.