XML format
XML sitemap
A list of a site's URLs with optional freshness hints, read by every major search engine.
A sitemap is the simplest useful XML document most teams operate: a <urlset> root containing one <url> per page, each with a mandatory <loc>. Everything else — lastmod, changefreq, priority — is a hint, and search engines weight them very differently.
Because it is generated rather than hand-written, a sitemap fails in generated ways: a routing change silently drops a whole section, a build stamps every lastmod with the deploy time, or pagination pushes the file past a hard limit. None of those are XML errors, so validation alone will not catch them.
Constraints that bite
- At most 50,000 <url> entries and 50 MB uncompressed per file; split into a sitemap index beyond that.
- <loc> must be absolute, fully qualified, and entity-escaped — a raw & in a query string makes the file malformed.
- All URLs in one sitemap must share the host that serves the sitemap, unless cross-submission is configured.
- lastmod must be W3C Datetime; stamping it with the build time trains crawlers to ignore it.
- hreflang alternates require the XHTML namespace and an xhtml:link per alternate, on every URL in the set.
- Root element
<urlset>- Media type
application/xml- Extensions
.xml, .xml.gz- Namespaces
http://www.sitemaps.org/schemas/sitemap/0.9
- XMLDir label
sitemap
Specification: sitemaps.org protocol
A minimal valid document
Every example on this site is checked against the same parser the workspace uses, so what you see below is known to be well-formed.
<?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-20</lastmod>
<changefreq>weekly</changefreq>
</url>
</urlset>Namespaces you will meet
Sitemap protocol 0.9
http://www.sitemaps.org/schemas/sitemap/0.9The namespace every sitemap.xml and sitemap index must declare. Almost always the default namespace.
XHTML
http://www.w3.org/1999/xhtmlXHTML markup — and, in sitemaps, the namespace that carries hreflang alternates.
Google image sitemap extension
http://www.google.com/schemas/sitemap-image/1.1Declares the images belonging to each <url> entry in a sitemap.
Google news sitemap extension
http://www.google.com/schemas/sitemap-news/0.9Publication name, language and publication date for news articles in a sitemap.
Google video sitemap extension
http://www.google.com/schemas/sitemap-video/1.1Thumbnail, duration, player and content locations for video content in a sitemap.
Get started
Bring order to the XML your team can't afford to ignore.
Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.