# XML sitemap

Category: [Crawling & Indexing](https://seo-geo-glossary.com/en/glossary/category/crawling-indexing/) › [Sitemaps & feeds](https://seo-geo-glossary.com/en/glossary/category/crawling-indexing/sitemaps-feeds/) · Also known as: sitemap, sitemap.xml

An **XML sitemap** is a file in XML format that lists the URLs of a website a search engine should crawl and index, optionally with the date each page last changed. Its structure is defined by the Sitemaps protocol published at sitemaps.org.

## What does an XML sitemap contain?

The required elements are `<urlset>`, one `<url>` entry per page and the page address in `<loc>`. The protocol also defines the optional `<lastmod>`, `<changefreq>` and `<priority>`. One file may hold at most 50,000 URLs and may not exceed 50 MB uncompressed. Larger sites split their URLs across several files and list them in a sitemap index.

Google requires UTF-8 encoding and fully qualified, absolute URLs. It ignores `<priority>` and `<changefreq>`. It does use `<lastmod>` if the value is consistently and verifiably accurate, meaning it reflects the last significant change to the page.

## How does Google find a sitemap?

Site owners submit a sitemap in the Search Console Sitemaps report, through the Search Console API, or with a `Sitemap:` line in robots.txt. Google deprecated the old ping endpoint in June 2023 and announced it would stop working six months later. Submitting a sitemap is, in Google's words, "merely a hint." Google does not guarantee it will download the file or crawl every URL in it.

## Example

```xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/cargo-bikes/</loc>
    <lastmod>2026-09-28</lastmod>
  </url>
  <url>
    <loc>https://www.example.com/cargo-bikes/longtail-20/</loc>
    <lastmod>2026-10-02</lastmod>
  </url>
</urlset>
```

Reference in robots.txt:

```robots
Sitemap: https://www.example.com/sitemap.xml
```

## Common mistakes

- **Listing the wrong URLs.** Redirected URLs, pages with `noindex` and error pages do not belong in a sitemap. Google recommends listing the canonical URLs you want to appear in search results.
- **Setting lastmod to the export date.** If the value changes without real content changes, Google stops relying on it.
- **Stale sitemaps after a relaunch.** The file keeps listing old addresses instead of the new ones.

## FAQ

**Is an XML sitemap still needed?**
Google recommends one for large sites, new sites with few external links and sites with a lot of video, images or news content. For small, well-linked sites of about 500 pages or fewer, Google says a sitemap may not be necessary.

**How do I find the XML sitemap of a website?**
Check robots.txt for a `Sitemap:` line first. Common locations are `/sitemap.xml` and `/sitemap_index.xml`, but the path is not fixed.

## At a glance

- **Type:** File in XML format (Sitemaps protocol 0.9)
- **Affects:** Discovery and crawling of URLs
- **Values:** Required: <urlset>, <url>, <loc>; optional: <lastmod>, <changefreq>, <priority>
- **Limit per file:** 50,000 URLs or 50 MB uncompressed
- **Specification:** [sitemaps.org protocol](https://www.sitemaps.org/protocol.html)
- **Docs:** [Google: Build and submit a sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap)

Last checked: October 8, 2026

## Sitemap types compared

| Type | Purpose | Limits | Required elements |
|---|---|---|---|
| XML sitemap | a file with information about the pages, videos and other files on a site and the relationships between them | at most 50,000 URLs or 50 MB (uncompressed) per file; UTF-8, absolute URLs | urlset, and per URL a url with loc |
| Sitemap index | groups several sitemaps so they can be submitted together | at most 50,000 sitemaps and 50 MB per index; up to 500 index files per site in Search Console | sitemapindex, and per sitemap a sitemap with loc |
| Image sitemap | tells Google about images it might not otherwise find, such as images loaded with JavaScript | up to 1,000 image:image per url; otherwise as for XML sitemaps | image:image with image:loc |
| Video sitemap | adds information about videos hosted on the pages | as for XML sitemaps; description at most 2,048 characters | video:video with video:thumbnail_loc, video:title, video:description and either video:content_loc or video:player_loc |
| News sitemap | tells Google about news articles with extra details | up to 1,000 news:news per file; only articles from the last two days | news:news with news:publication (news:name, news:language), news:publication_date, news:title |
| Sitemap with hreflang | lists the language and regional versions of a page | as for XML sitemaps | per url a loc and one xhtml:link rel="alternate" hreflang="…" for every version, including the page itself |
| HTML sitemap | a page of links for visitors to the site | – (not part of the sitemap protocol; Google says it cannot be submitted as a sitemap. Source: Google Search Central Blog, 2005) | – |

Sources: [Google Search Central: Build and submit a sitemap (last updated 2025-12-10)](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap); [Google Search Central: Manage your sitemaps with sitemap index files](https://developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps); [Google Search Central: Image sitemaps](https://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps); [Google Search Central: Video sitemaps](https://developers.google.com/search/docs/crawling-indexing/sitemaps/video-sitemaps); [Google Search Central: Create a news sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap); [Google Search Central: Localized versions of your pages (sitemap method)](https://developers.google.com/search/docs/specialty/international/localized-versions); [sitemaps.org: Sitemaps XML format](https://www.sitemaps.org/protocol.html); [Google Search Central Blog (2005): How is a Google Sitemap different from an HTML sitemap?](https://developers.google.com/search/blog/2005/09/how-is-google-sitemap-different-from). Last checked: October 8, 2026

## Not to be confused with

- [HTML sitemap](https://seo-geo-glossary.com/en/glossary/html-sitemap/index.md): is a regular page with links to a site's content, made for visitors. The XML file is meant for search engines.

## Related terms

- [Sitemap index](https://seo-geo-glossary.com/en/glossary/sitemap-index/index.md)
- [lastmod](https://seo-geo-glossary.com/en/glossary/lastmod/index.md)
- [robots.txt](https://seo-geo-glossary.com/en/glossary/robots-txt/index.md)
- [Indexing](https://seo-geo-glossary.com/en/glossary/indexing/index.md)

## Sources

- [Sitemaps XML format – sitemaps.org](https://www.sitemaps.org/protocol.html)
- [Build and submit a sitemap – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap)
- [Learn about sitemaps – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview)
- [Sitemaps ping endpoint is going away – Google Search Central Blog, June 2023](https://developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping)

---

Last updated: October 8, 2026
URL: https://seo-geo-glossary.com/en/glossary/xml-sitemap/
