A sitemap is a file that lists the pages on your website you want search engines to know about. Google’s definition: “a file where you provide information about the pages, videos, and other files on your site, and the relationships between them.” Search engines read it “to crawl your site more efficiently”[1]. That is the whole idea. The rest of this page shows what one looks like, tag by tag, when you need one, and what it can and cannot do for SEO and for AI search.
Already have one? Paste your domain into the free sitemap validator to see your own sitemap laid out, with every problem flagged.
Sources: the sitemap protocol[3]; Google’s sitemap overview[1] and image sitemap guide[5].
What a sitemap is, and the three things people mean by it
The word covers three different things, and most confusion comes from mixing them up[17]:
- A planning sitemap. A diagram designers draw before building a site, showing its pages and how they connect. It never goes online.
- An HTML sitemap. A page for visitors, usually linked from the footer, listing the site’s sections. Crawlers can follow its links too.
- An XML sitemap. A file for crawlers. This is the one Search Console asks for, and the one this page is about.
The XML format is shared: “Google supports the sitemap formats defined by the sitemaps protocol”[2], and Bing says it “continues full support of the Sitemap protocol”[12]. One file serves every search engine.
An XML sitemap example, line by line
Here is a minimal, valid XML sitemap example with two pages. The comments mark the six things that matter; you can leave them in, since XML comments are ignored.
<?xml version="1.0" encoding="UTF-8"?>
<!-- 1. The root. The xmlns value must be exactly this. -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<!-- 2. One <url> per page -->
<url>
<!-- 3. Required: the full, absolute URL, as you want it in search results -->
<loc>https://www.example.com/</loc>
<!-- 4. Optional: when the page last changed in a significant way -->
<lastmod>2026-09-30</lastmod>
</url>
<url>
<!-- 5. Escape & as & inside URLs, or the file will not parse -->
<loc>https://www.example.com/shoes?colour=red&size=9</loc>
<!-- 6. A date and time needs a time zone -->
<lastmod>2026-10-02T09:15:00+00:00</lastmod>
</url>
</urlset>The rules behind each comment come from the protocol and Google:
- The root and namespace. The file must open with
<urlset>, close with</urlset>and specify the namespace in the opening tag. It must be UTF-8[3]. - Full URLs. Each
<loc>must begin with the protocol and be under 2,048 characters[3]. Google asks for “fully-qualified, absolute URLs” and says it will crawl them “exactly as listed”[2]. - Only URLs you want in search. “Include the URLs in your sitemap that you want to see in Google’s search results”, meaning the canonical version of each page[2].
- Escaping. An ampersand must be written
&, and the same applies to quotes and angle brackets[3]. - One host. All URLs in a sitemap must come from a single host, and a sitemap in a folder can only list URLs in that folder[3].
- Order does not matter. Google: “You don’t have to worry about the order of the URLs in your sitemap”[2].
The four tags, and what Google does with each
| In the protocol | Bing | ||
|---|---|---|---|
| <loc> | Required | Crawls the URL exactly as listed | Required |
| <lastmod> | Optional. Date the page was last modified | Used if "consistently and verifiably" accurate | A "key signal" for what to recrawl |
| <changefreq> | Optional. "A hint and not a command" | Ignored | Ignored |
| <priority> | Optional. 0.0 to 1.0, relative to your own pages | Ignored | Ignored |
Sources: protocol[3]; Google[2]; Bing[12]. The guide to lastmod, priority and changefreq covers the dates in depth.
A sitemap index example
One file may hold at most 50,000 URLs or 50 MB uncompressed. Past that, you split the URLs into several sitemaps and list them in a sitemap index, which has the same shape with a different root[3]. Google lets you submit the index alone instead of every file[4].
<?xml version="1.0" encoding="UTF-8"?>
<!-- A sitemap index lists sitemaps, not pages -->
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/sitemaps/posts.xml</loc>
<!-- When this sitemap file changed, not the pages in it -->
<lastmod>2026-10-01T18:23:17+00:00</lastmod>
</sitemap>
<sitemap>
<!-- Child sitemaps may be gzipped -->
<loc>https://www.example.com/sitemaps/products.xml.gz</loc>
</sitemap>
</sitemapindex>In an index, <lastmod> is when the child sitemap file changed. The protocol says it “does not correspond to the time that any of the pages listed in that Sitemap were changed”, and lets a crawler fetch only the sitemaps modified since its last visit[3]. Google does not allow an index inside an index; Search Console reports it as nested indexing[9].
Image, video, news and language examples
Google supports extensions that add detail to a <url> entry. Each one declares its own namespace on the root, and each can live in your main sitemap or in a separate file[5][6][7].
<url> can list up to 1,000 images, and images may sit on another domain if both are verified in Search Console[5].<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://www.example.com/recipes/flatbread</loc>
<!-- Up to 1,000 images per page -->
<image:image>
<image:loc>https://www.example.com/img/flatbread.jpg</image:loc>
</image:image>
<image:image>
<image:loc>https://cdn.example.com/img/flatbread-dough.jpg</image:loc>
</image:image>
</url>
</urlset>content_loc or player_loc. Every URL in it must be reachable by Googlebot, including “not be blocked by firewalls or similar mechanism”[6].<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url>
<!-- The page the video is embedded on -->
<loc>https://www.example.com/videos/knead-dough</loc>
<video:video>
<video:thumbnail_loc>https://www.example.com/thumbs/knead.jpg</video:thumbnail_loc>
<video:title>How to knead dough</video:title>
<video:description>Kneading by hand in four minutes.</video:description>
<!-- Either the media file or a player URL; the file is preferred -->
<video:content_loc>https://www.example.com/media/knead.mp4</video:content_loc>
</video:video>
</url>
</urlset><news:news> tags per sitemap, and give the original publication date, not the time you added the article[7].<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
<url>
<loc>https://www.example.com/news/bakery-opens</loc>
<news:news>
<news:publication>
<!-- Must match your name as it appears on Google News -->
<news:name>The Example Times</news:name>
<news:language>en</news:language>
</news:publication>
<!-- When the article was first published, not when it was added here -->
<news:publication_date>2026-10-10</news:publication_date>
<news:title>A new bakery opens on Main Street</news:title>
</news:news>
</url>
</urlset><url> lists “every alternate version of the page, including itself”, so three versions mean three entries with three identical sets of links[8].<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://www.example.com/en/menu</loc>
<!-- Every language version, including this one -->
<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/menu"/>
<xhtml:link rel="alternate" hreflang="de" href="https://www.example.com/de/menu"/>
</url>
<url>
<loc>https://www.example.com/de/menu</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/menu"/>
<xhtml:link rel="alternate" hreflang="de" href="https://www.example.com/de/menu"/>
</url>
</urlset>.txt[2]. There is nowhere to put a date, so it sends no freshness signal. Google also accepts RSS 2.0 and Atom 1.0 feeds, which only cover recent URLs[2].https://www.example.com/ https://www.example.com/about https://www.example.com/shoes?colour=red&size=9
What real sitemaps look like
Examples in documentation are tiny. Real ones are not. Here is what five public sites served when we fetched their sitemaps on 11 October 2026:
| Shape | Size | Worth noticing | |
|---|---|---|---|
| nextjs.org | One <urlset> | 713 URLs | Every URL dated; all 20 sampled URLs answered 200 |
| yoast.com | A sitemap index of 21 files | 1,698 entries in the 20 we read | 36 duplicate URLs; 128 entries without a date |
| www.wix.com | One <urlset> | 10,525 URLs | 79% share one lastmod timestamp; one date in the future |
| techcrunch.com | An index of 2,000+ files, plus a news sitemap | 10,023 entries in the first 51 files | robots.txt disallows GPTBot and ClaudeBot from every one |
| nytimes.com | 25 sitemaps declared in robots.txt | Not counted | Separate files for news, video, recipes, Wirecutter and more, some gzipped |
Two lessons. First, a large site’s sitemap is a tree, which is why the guide to finding a sitemap starts with robots.txt rather than one URL. Second, being valid XML is not the same as being right. Duplicates, missing or identical dates and URLs blocked for some crawlers all pass a schema check.
Do I need a sitemap?
Google answers this directly. “If your site’s pages are properly linked, Google can usually discover most of your site”, but a sitemap “can improve the crawling of larger or more complex sites”[1]. Its two lists, in full:
| You might need one if | You might not if | |
|---|---|---|
| Size | Your site is large, so some pages may not be linked from any other | Your site is about 500 pages or fewer (counting only pages you want in search) |
| Links | Your site is new and has few external links | Every important page can be reached by links from the home page |
| Media | You have a lot of video or images, or appear in Google News | You have few media files or news pages you want in search |
Two more cases from Google. If you use a CMS such as WordPress, Wix or Blogger, “it’s likely that your CMS has already made a sitemap available”[1]. And Search Console’s help says hosted sites on services such as Squarespace or Wix probably have it managed for them[9]. Even when you could skip it, Google adds that “in most cases, your site will benefit from having a sitemap”[1]. It costs little, so most sites should have one.
Does a sitemap help SEO?
It helps search engines find pages. It does not help them rank. Google is careful here: a sitemap “helps search engines discover URLs on your site, but it doesn’t guarantee that all the items in your sitemap will be crawled and indexed”[1]. Submitting one “is merely a hint”[2]. The protocol says the same about the tag most people tweak: priority “is not likely to influence the position of your URLs in a search engine’s result pages”[3].
What a good sitemap does for SEO, in practice:
- Discovery. New pages and pages with few internal links get found sooner.
- Recrawling. Accurate
<lastmod>dates tell Google and Bing which pages changed. Bing says the date helps it “prioritize URLs for recrawling and reindexing, or skip them entirely if the content hasn’t changed”[12]. - Canonical hints. Google “generally shows the canonical URLs in its search results, which you can influence with sitemaps”[2]. List the version of each page you prefer.
- Diagnostics. Search Console counts the pages discovered in each submitted sitemap and lets you filter the Page indexing report by sitemap[9].
Sitemaps and AI crawlers
Separate what is documented from what is assumed.
Documented by Bing. In July 2025, Bing wrote that for AI powered search engines, “freshness signals directly influence how quickly updates are reflected in search results and AI generated answers”, and that <lastmod> remains a key signal[12]. The same post says a working sitemap supports “both traditional search and AI-powered experiences like Copilot”[12].
Documented by Google. To appear as a supporting link in AI Overviews or AI Mode, “a page must be indexed and eligible to be shown in Google Search with a snippet”, with “no additional technical requirements”[11]. A sitemap helps indexing, so it helps eligibility, and nothing more specific than that.
Not documented by the AI companies. OpenAI’s crawler page describes OAI-SearchBot, which surfaces sites in ChatGPT search, and GPTBot, which collects training data[14]. Anthropic describes ClaudeBot and Claude-SearchBot[15], and Perplexity describes PerplexityBot, which “is designed to surface and link websites in search results on Perplexity”[16]. All three explain their robots.txt rules. None of the three pages, as we read them on 11 October 2026, mentions sitemaps. So nobody outside those companies can tell you how much their crawlers use one.
How to make and submit one
Google lists three routes: let your CMS generate it, write it by hand if it has “less than a few dozen URLs”, or generate it from your site’s database for anything larger[2]. On WordPress, Shopify, Wix and Squarespace it already exists; the guide to finding a sitemap gives each platform’s address. On a Next.js site, the Next.js sitemap guide has the code.
Then tell search engines where it is. Google accepts three ways: the Sitemaps report in Search Console, the Search Console API, or a line anywhere in robots.txt, such as Sitemap: https://example.com/my_sitemap.xml[2]. Google retired its old sitemap “ping” endpoint in 2023[10]; the lastmod guide explains what took its place. If Search Console then says the sitemap could not be read, that guide walks through each cause.
Questions people ask
What is a sitemap in simple words?
A sitemap is a file that lists the pages on a website you want search engines to know about, with optional details such as when each page last changed. Search engines read it to find pages they might miss by following links. It is usually an XML file at /sitemap.xml, generated by your CMS.
Do I need a sitemap?
Google says you might not if your site is about 500 pages or fewer, is well linked internally, and has few videos, images or news pages you want in search. You probably need one if the site is large, new with few external links, or heavy on video, images or news. If you use Wix, Squarespace or a similar host, it probably makes one for you.
Does a sitemap help SEO?
It helps search engines find and crawl your pages, which is the first step to ranking. It does not make pages rank higher, and Google says it does not guarantee that every listed page will be crawled or indexed. The optional priority tag does not change rankings either.
What is an example of an XML sitemap?
The smallest valid one is an XML declaration, a <urlset> root with the namespace http://www.sitemaps.org/schemas/sitemap/0.9, and one <url> holding a <loc> with a full URL. You can add a <lastmod> date. This page shows that example annotated line by line, plus index, image, video, news and hreflang examples.
What is the difference between an HTML sitemap and an XML sitemap?
An HTML sitemap is a page for people, usually linked from the footer, listing the site's sections and pages. An XML sitemap is a file for crawlers, in the format defined at sitemaps.org. They do different jobs, and a site can have both.
Do AI crawlers use sitemaps?
Bing says sitemaps and accurate lastmod dates influence how quickly updates reach its search results and AI generated answers. Google's AI Overviews and AI Mode only cite indexed pages. OpenAI, Anthropic and Perplexity document their crawlers and robots.txt rules but, on the pages we read, say nothing about sitemaps.
