In this article
Search engines find pages by following links. That works well for pages linked from your home page, and poorly for new pages, deep pages or pages nobody has linked yet. A sitemap.xml file hands the crawler a clean list of the addresses you want found, along with when each last changed.
How a sitemap fits into crawling
- 1You publish /sitemap.xmlThe file sits at the root of your site, for example example.com/sitemap.xml.
- 2You tell crawlersAdd a Sitemap: line to robots.txt and submit the file in Google Search Console and Bing Webmaster Tools.
- 3The crawler reads itIt queues the listed URLs and notes the lastmod dates.
- 4Pages are fetchedEach page is checked for quality, redirects, blocks and duplicate content.
- 5Good pages are indexedOnly some listed pages will be indexed. The sitemap is a request, not an order.
Many sites have thousands of pages listed but far fewer indexed. The gap is a quality signal worth investigating.
What a sitemap file looks like
A sitemap is plain XML. It starts with a urlset wrapper, and each page sits in its own url block. Only loc is required.
| Tag | Required? | What it holds | Does Google use it? |
|---|---|---|---|
loc | Yes | The full page address, including https:// | Yes |
lastmod | No | The date the page last changed in a meaningful way, e.g. 2026-10-09 | Yes, when it proves accurate |
changefreq | No | A hint such as daily or monthly | No, ignored |
priority | No | A number from 0.0 to 1.0 | No, ignored |
Do not set lastmod to today on every build. If the date changes without the content changing, search engines learn to ignore it.
The size limits
One sitemap file may contain at most 50,000 URLs and be at most 50 MB uncompressed. The URL count is usually the limit you hit first. Go beyond it and you split the list into several files, then list those files in a sitemap index.
A small sitemap-index.xml then lists the three files. Submit only the index.
Files needed = pages ÷ 50,000, rounded up. Many large sites split by section (blog, products) rather than by count, which makes problems easier to trace.
What to include and what to leave out
A sitemap full of redirected or blocked URLs wastes crawl attention and makes reports noisy.
- Includes 404 and redirected URLs
- Mixes http and https, www and non-www
- lastmod changes on every deploy
- Only live, canonical pages
- One consistent address format
- lastmod changes only when content does
Search engines build trust in a sitemap over time. Accurate files get read more attentively.
Where to put it and how to announce it
- Save it at the site root as
/sitemap.xml. A sitemap can only list URLs at or below its own folder. - Add one line to robots.txt:
Sitemap: https://yourdomain.com/sitemap.xml(use the full address). - Submit it in Google Search Console and Bing Webmaster Tools, under Sitemaps.
- Check the report. Look for 'discovered' versus 'indexed' counts and any errors.
- Regenerate on change. New pages should appear automatically; this is easy if your build creates the file.
XML sitemap versus HTML sitemap
- File at /sitemap.xml
- Lists every important URL with dates
- Not meant to be read by people
- A normal page, such as /site-map
- Links to sections, tools and articles
- Helps people who are lost and also gives crawlers more links
Use both. The XML file feeds search engines; the HTML page helps humans and adds internal links.
A good HTML sitemap groups links by topic, stays readable (a few hundred links at most on one page) and is linked from the footer of every page. It also helps with accessibility, since it is a reliable second way to navigate.
Quick checklist
- Every URL is absolute, starts with https:// and uses the same host.
- Each page returns 200, has no noindex and points to itself as canonical.
- The file is UTF-8 and the special characters in addresses are properly escaped.
- The file is under 50,000 URLs and 50 MB, or split with an index.
- robots.txt points to the sitemap and the sitemap is submitted in Search Console.
Questions people ask
What is a sitemap.xml?
It is an XML file listing the URLs of a website that you want search engines to discover, optionally with the date each page last changed. It usually lives at /sitemap.xml.
Do I need a sitemap for a small website?
Not strictly, since a well-linked small site is easily crawled. A sitemap still helps new pages appear sooner and gives you indexing reports, so it is worth having.
How many URLs can a sitemap hold?
Up to 50,000 URLs and 50 MB uncompressed per file. Larger sites use several sitemap files listed in a sitemap index file.
Does Google use priority and changefreq?
No. Google ignores both. It reads the loc tag and uses lastmod when the dates have proved reliable.
What is the difference between an HTML and an XML sitemap?
An XML sitemap is a machine-readable file for search engines. An HTML sitemap is a normal web page with links for human visitors, and it also adds internal links for crawlers.
How do I tell search engines about my sitemap?
Add a Sitemap line with the full address to robots.txt and submit the file in Google Search Console and Bing Webmaster Tools.

