Updated July 19, 2026
sitemap.xml tags reference
A sitemap.xml lists the URLs a search engine should know about. This sheet covers the URL-level tags, the sitemap-index tags for large sites, and the format rules that keep a sitemap valid.
URL sitemap tags
Namespace: http://www.sitemaps.org/schemas/sitemap/0.9 on the <urlset> root.
| Tag | Required | Purpose |
|---|---|---|
<urlset> | Yes | Root element; carries the sitemaps.org namespace. |
<url> | Yes | One entry per page. Wraps the tags below. |
<loc> | Yes | The full, absolute URL of the page. Must be under 2,048 characters. |
<lastmod> | No | Last modification date in W3C format (YYYY-MM-DD). Google uses it when consistent. |
<changefreq> | No | Hint: always, hourly, daily, weekly, monthly, yearly, never. Largely ignored by Google. |
<priority> | No | Hint from 0.0 to 1.0 (default 0.5). Largely ignored by Google. |
Sitemap index tags (for large sites)
| Tag | Purpose |
|---|---|
<sitemapindex> | Root element of an index that points to other sitemaps. |
<sitemap> | One entry per child sitemap. |
<loc> | Absolute URL of a child sitemap file. |
Example
A URL sitemap and, below, a sitemap index that lists two.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2026-07-19</lastmod>
</url>
</urlset>
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-1.xml</loc>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-2.xml</loc>
</sitemap>
</sitemapindex>Size limitsA single sitemap may contain at most 50,000 URLs and be at most 50 MB uncompressed. Split larger sets across multiple sitemaps and reference them from a sitemap index. Sitemaps may be gzip-compressed.
Point crawlers to itList the sitemap URL in robots.txt (
Sitemap: https://example.com/sitemap.xml) and submit it in Search Console. Use only canonical, indexable, absolute URLs.References
Questions
Which sitemap tags are required?
Only <urlset>, <url>, and <loc>. <lastmod>, <changefreq>, and <priority> are optional, and Google now relies mainly on <lastmod>.
How many URLs can one sitemap hold?
Up to 50,000 URLs and 50 MB uncompressed. Beyond that, split into multiple sitemaps and list them in a <sitemapindex> file.
What date format does <lastmod> use?
W3C datetime — commonly YYYY-MM-DD, or a full timestamp like 2026-07-19T10:30:00+00:00.