XML sitemap
A file listing your URLs (and sometimes last-changed dates) so crawlers know what to fetch. It complements internal links and Search Console settings—it does not replace them.
An XML list of page addresses you give search engines to help them find and refresh your pages. Large sites usually split it into several files or compress it.
Why it exists
Sitemaps accelerate discovery for fresh or deeply nested URLs and after migrations. They do not guarantee indexing or rankings—think of them as a structured hint to crawlers, not a shortcut past quality thresholds.
url & sitemapindex fields
These tags belong to the core sitemaps.org schema. Extensions (images, video, news, hreflang) add their own namespaces and child elements inside each url.
Child tags of url
| Tag | Required | Purpose |
|---|---|---|
| loc | Yes | Canonical absolute page URL (prefer https; avoid session noise) |
| lastmod | No | Last meaningful content change (W3C Datetime, with or without timezone) |
| changefreq | No | Hint: always, hourly, daily, weekly, monthly, yearly, never (often ignored) |
| priority | No | 0.0–1.0 relative to other URLs on the same site; not a ranking signal |
Child tags of sitemap (inside sitemapindex)
| Tag | Required | Purpose |
|---|---|---|
| loc | Yes | URL of the child sitemap file (plain .xml or .xml.gz) |
| lastmod | No | Optional hint about when the child file last changed |
Example: standard urlset
The root urlset declares the default namespace http://www.sitemaps.org/schemas/sitemap/0.9. You can emit many url entries; each must contain exactly one loc.
<?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-05-01</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.example.com/blog/sitemap-xml</loc>
<lastmod>2026-05-01T12:00:00+03:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
</urlset>Example: sitemap index
A sitemapindex never lists page URLs directly—it only points to child sitemap files. Splitting by section (blog, catalogue, landing pages) or content type keeps ownership clear.
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/sitemaps/static.xml</loc>
<lastmod>2026-05-01</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemaps/blog.xml.gz</loc>
<lastmod>2026-05-01</lastmod>
</sitemap>
</sitemapindex>Example: News sitemap
Google’s news extension wraps fresh editorial URLs with news:news metadata (publication name, language, publication date, title). Publishers often isolate news URLs in a dedicated child sitemap—check Google’s freshness and volume rules.
<?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/crawlers-refreshed-the-index</loc>
<news:news>
<news:publication>
<news:name>Example Times</news:name>
<news:language>en</news:language>
</news:publication>
<news:publication_date>2026-05-01T09:15:00+03:00</news:publication_date>
<news:title>Crawlers refreshed the index</news:title>
</news:news>
</url>
</urlset>Example: images
Each loc page can list one or many images:image blocks. image:loc is mandatory; caption/title add context for Google Image search.
<?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/gallery/moscow-night</loc>
<image:image>
<image:loc>https://cdn.example.com/photos/moscow-1600.webp</image:loc>
<image:caption>Moscow skyline at night</image:caption>
<image:title>Moscow riverfront</image:title>
</image:image>
<image:image>
<image:loc>https://cdn.example.com/photos/moscow-thumb.webp</image:loc>
</image:image>
</url>
</urlset>Example: video
A video:video block describes the clip: thumbnail, title, description, media file or player page, duration in seconds. Required combinations depend on hosting style—see Google’s video sitemap reference.
<?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>
<loc>https://www.example.com/watch/seo-audit-intro</loc>
<video:video>
<video:thumbnail_loc>https://cdn.example.com/thumbs/audit-intro.jpg</video:thumbnail_loc>
<video:title>Technical SEO audit intro</video:title>
<video:description>A short overview of audit deliverables.</video:description>
<video:content_loc>https://cdn.example.com/video/audit-intro.mp4</video:content_loc>
<video:duration>612</video:duration>
</video:video>
</url>
</urlset>Example: multilingual (hreflang)
Alternate language URLs can be listed inside the same url entry via xhtml:link with rel="alternate" and hreflang. Many teams mirror the full cluster on every localized URL; sitemap hreflang must match on-page annotations.
<?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/ru/services/seo-audit</loc>
<xhtml:link rel="alternate" hreflang="ru" href="https://www.example.com/ru/services/seo-audit"/>
<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/services/seo-audit"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/en/services/seo-audit"/>
</url>
<url>
<loc>https://www.example.com/en/services/seo-audit</loc>
<xhtml:link rel="alternate" hreflang="ru" href="https://www.example.com/ru/services/seo-audit"/>
<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/services/seo-audit"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/en/services/seo-audit"/>
</url>
</urlset>Format & limits
Each uncompressed sitemap may contain up to 50,000 URLs and weigh up to roughly 50 MB; larger sites emit multiple child sitemaps referenced by a sitemap index. gzip transport is fine, but URL caps still apply per logical file.
- News/image/video/xhtml extensions increase payload size—watch the 50 MB / 50k URL caps.
- Keep lastmod trustworthy—mass fake updates erode trust.
- Treat changefreq/priority as optional hints; engines may ignore them.
- Validate UTF-8 encoding and XML well-formedness in CI.
Sitemap hygiene
- Drop 4xx/5xx targets, redirect chains, and duplicate URLs.
- Align entries with canonical tags and crawlable content.
- Monitor Search Console coverage and server logs for ignored sections.
Common questions
Discuss your project?
Share your goals and website context — I will suggest a practical next step.