XML sitemap
What is an XML sitemap?
An XML sitemap is a file, usually at /sitemap.xml, that lists the URLs on a site you want search engines to crawl and index. Each entry gives the page’s full URL and, optionally, when it last changed. It helps crawlers find pages faster, but it does not guarantee that they will be crawled or indexed.

The format comes from the sitemaps.org protocol, which Google, Bing and other engines share. A single sitemap can hold up to 50,000 URLs or 50 MB uncompressed. Bigger sites split their URLs across several sitemaps and list those in a sitemap index file. Sitemaps can be gzipped to save bandwidth.
Each <url> entry has a required <loc> with an absolute URL. The optional <lastmod> gives the date of the last meaningful change. The protocol also defines <priority> and <changefreq>, but Google ignores both. Google uses <lastmod> only when it is consistently and verifiably accurate, so it should change when the content, structured data or links change, not every time the page is rebuilt.
There are also extensions for images, videos and news, plus the option to list hreflang alternates inside the sitemap rather than in each page’s HTML.
Why XML sitemap matters for SEO
Search engines mainly discover pages by following links. A sitemap is a second route in. It matters most for large sites, new sites with few backlinks, sites that publish often, and pages that are poorly linked internally, such as deep product pages.
A sitemap is also a statement of intent. It tells Google which URL you consider the canonical version of each page. Listing redirected, noindexed, broken or non-canonical URLs sends mixed signals and makes your sitemap less trustworthy, so keep it to indexable 200-status pages only.
Once you submit it, the Sitemaps report and page indexing report in Google Search Console show how many listed URLs are indexed, which is one of the quickest ways to spot indexing problems.
How to create an XML sitemap
- Generate it automatically. Most CMSs and frameworks can build a sitemap from your content, which keeps it in step as pages are added and removed. Hand-written sitemaps go stale.
- Include only canonical, indexable URLs that return 200. Leave out redirects, 404s, noindexed pages, URLs blocked by robots.txt and parameter variants.
- Use absolute URLs on the same protocol and host as the site: https://www.example.com/page, not /page.
- Set
<lastmod>from the real last-modified date of the content, in W3C date format (2026-10-01 or 2026-10-01T09:30:00+00:00). Do not set every URL to today’s date. - Split past 50,000 URLs or 50 MB. Group URLs by type (products, categories, articles) so you can see indexing rates per section, and link each sitemap from a sitemap index.
- Submit the sitemap or sitemap index in Search Console and Bing Webmaster Tools, and add a
Sitemap:line to robots.txt so every crawler can find it. - Check the Sitemaps report after each big change for fetch errors and a falling indexed count.
XML sitemap example
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-10-01</lastmod>
</url>
<url>
<loc>https://www.example.com/guides/robots-txt</loc>
<lastmod>2026-09-14</lastmod>
</url>
</urlset>XML sitemap FAQ
Do I need an XML sitemap?
Small, well-linked sites can be crawled fine without one, but a sitemap costs little and helps Google and Bing find new and updated pages. Large sites, new sites and sites with deep or poorly linked pages benefit most.
How many URLs can a sitemap have?
Up to 50,000 URLs or 50 MB uncompressed per sitemap file. Beyond that, split the URLs into several sitemaps and list them in a sitemap index.
Does Google use priority and changefreq?
No. Google ignores <priority> and <changefreq>. It uses <lastmod> only when the dates are consistently accurate.
Can I still ping Google with my sitemap?
No. Google retired the sitemap ping endpoint in 2023. Submit the sitemap in Search Console or reference it in robots.txt; Google rechecks it on its own. For Bing and some other engines, IndexNow is the way to notify changes.
Related SEO terms
An HTML sitemap is a normal web page that links to a site’s main sections and pages, mainly to help visitors and crawlers navigate.
Robots.txt is a plain-text file at the root of a site that tells crawlers which URLs they may and may not request.
Indexing is when a search engine analyses a crawled page and stores it in its index, so it becomes eligible to appear in search results.
Crawling is how search engines discover pages: automated bots fetch URLs and follow the links on them to find more pages.
An orphan page is a page with no internal links pointing to it, so visitors and crawlers cannot reach it by browsing the site.
A canonical tag is a link element that tells search engines which URL is the main version of a page when duplicates exist.
IndexNow is an open protocol that lets a site notify search engines such as Bing and Yandex the moment a URL is added, changed or deleted.
Google Search Console is Google’s free tool that shows how your site performs in Google Search and flags indexing, security and spam problems.