Search engines find most pages by following links. A sitemap gives them a second route: a file on your site that lists the URLs you want them to know about, often with extra details such as when each page last changed. Most sitemaps are XML files at an address like https://example.com/sitemap.xml, and search engines read them alongside the links they find while crawling.
The word has two other meanings. An HTML sitemap is an ordinary page that lists a site's sections for visitors, and in web design a sitemap is a planning diagram of the pages to build. This article is about the file for search engines.
Does your site need a sitemap?
Many sites already have one: content management systems such as WordPress, Wix and Blogger usually create a sitemap for you. If yours does, check that it exists and lists the right pages, and you may not need to do anything else.
Google says a sitemap is most useful when (Google Search Central):
- Your site is large. The more pages you have, the harder it is to make sure every one is linked from somewhere.
- Your site is new and has few links from other sites. Crawlers find pages by following links, so a page nobody links to can go unnoticed.
- You have a lot of video or images, or appear in Google News. Sitemaps can carry extra details about these.
You might not need one if your site has about 500 pages or fewer that you want in search results, every important page can be reached by following links from the homepage, and you don't rely on media or news results.
Either way, a sitemap is a hint, not a request that must be followed. It helps search engines discover URLs, but it doesn't guarantee that they'll be crawled or indexed.
What goes in an XML sitemap
Here's a minimal sitemap with two pages:
<?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-09-14</lastmod>
</url>
<url>
<loc>https://www.example.com/pricing</loc>
<lastmod>2026-10-01</lastmod>
</url>
</urlset>
Each <url> entry needs a <loc>: the full, absolute address of the page, starting with https://. Google crawls the URLs exactly as you list them, so use the version you want to appear in results, the canonical URL, and leave out duplicates such as tracking-parameter versions.
The other tags are optional, and search engines treat them differently:
<lastmod>is the date the page last changed in a meaningful way. Google uses it only when it's consistently and verifiably accurate. A change to the main content, structured data or links counts; a new copyright year in the footer doesn't (Google Search Central). Bing also asks for lastmod as a freshness signal.<priority>and<changefreq>are part of the protocol, but Google ignores both. Don't spend time tuning them.
As in any XML file, special characters in URLs must be escaped: & becomes &. The file must be UTF-8 encoded.
Size limits and large sites
One sitemap can hold at most 50,000 URLs and 50MB uncompressed. You can gzip the file to save bandwidth, but the limit applies to the uncompressed size.
If you have more URLs, split them into several sitemaps and list those in a sitemap index file. An index uses <sitemapindex> and <sitemap> tags instead of <urlset> and <url>, and it can list up to 50,000 sitemaps. The sitemaps it lists must sit on the same site, in the same directory as the index or deeper (Google Search Central).
Location matters too. A sitemap affects only URLs in its own directory and below, unless you submit it through Search Console. That's why Google recommends putting it at the root of your site, where it can cover everything.
Splitting has a side benefit: if you submit each sitemap separately, Search Console reports on each one, so you can compare, say, product pages with blog posts.
Other sitemap formats
| Format | What it can describe | Good for |
|---|---|---|
| XML sitemap | Pages, plus images, video, news and language versions through extensions | Most sites |
| RSS 2.0 or Atom 1.0 feed | Pages and videos, usually only recent ones | Blogs whose CMS already makes a feed |
Text file (.txt) |
Page URLs only, one per line | Very simple setups |
For media, see image sitemaps and video sitemaps. For pages in several languages, an XML sitemap can also carry hreflang annotations.
How to submit a sitemap
You have three ways to tell Google about your sitemap:
- Search Console. Add it in the Sitemaps report of Google Search Console. The report also shows when Googlebot last read the file and any errors it found.
- robots.txt. Add a line such as
Sitemap: https://example.com/sitemap.xmlanywhere in your robots.txt file. You can list as many sitemaps as you like. - The Search Console API, if you manage many sites or generate sitemaps automatically.
Older guides also mention "pinging" a sitemap URL to Google. Google announced in June 2023 that it was retiring that endpoint, and it has since shut it down: pings return a 404 error and do nothing (Google Search Central Blog).
Bing uses XML sitemaps too. To tell Bing quickly that a page was added, changed or removed, it recommends IndexNow alongside the sitemap.
Common sitemap mistakes
- Listing URLs you don't want indexed. Google asks for the URLs you want in its results, so pages with a noindex rule, pages blocked in robots.txt, redirects and duplicates don't belong. Bing asks you to remove deleted and redirected URLs promptly.
- Setting every lastmod to today. Google uses lastmod only when it's consistently accurate, so dates that don't match real changes get ignored.
- Relative URLs.
/pricingdoesn't work; writehttps://www.example.com/pricing. - A sitemap that falls behind. A hand-made file is fine for a few dozen pages. Beyond that, have your CMS or site software generate it, so new pages appear and deleted ones disappear without anyone remembering to edit it.