What Is an XML Sitemap
An XML Sitemap is a structured XML file containing a list of a website's URLs and metadata for each page, such as its last modified date, priority, and update frequency.
The file helps Google and Yandex search engine crawlers find and index pages more quickly, especially pages that are deeply nested or have no inbound links.
XML Sitemap Structure
Basic example
<?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-03-18</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/services/tech</loc>
<lastmod>2026-03-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>
</urlset>XML Sitemap tags
| Tag | Required | Description |
|---|---|---|
<loc> | Yes | The page's full URL |
<lastmod> | No | Last modified date (ISO 8601) |
<changefreq> | No | Update frequency |
<priority> | No | Priority (0.0–1.0) |
changefreq values
always, hourly, daily, weekly, monthly, yearly, never
Important: Google treats changefreq and priority as “hints,” not mandatory directives.
Sitemap Index (for large websites)
If you have more than 50 000 URLs or the file size is > 50 MB, use a Sitemap Index:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2026-03-18</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-blog.xml</loc>
<lastmod>2026-03-18</lastmod>
</sitemap>
</sitemapindex>Types of Specialized Sitemaps
- Image Sitemap — a separate sitemap for images
- Video Sitemap — for video content
- News Sitemap — for Google News (articles published in the last 48 hours)
How to Create and Add a Sitemap
Automatic generation (Next.js)
// app/sitemap.ts
import { MetadataRoute } from 'next'
export default function sitemap(): MetadataRoute.Sitemap {
return [
{
url: 'https://example.com',
lastModified: new Date(),
changeFrequency: 'daily',
priority: 1,
},
{
url: 'https://example.com/services',
lastModified: new Date(),
changeFrequency: 'weekly',
priority: 0.8,
},
]
}Add it to robots.txt
User-agent: *
Allow: /
Sitemap: https://example.com/sitemap.xml
Submit it in Google Search Console
Dashboard → Indexing → Sitemaps → Add sitemap.
Check Your Sitemap with reChecker
Use Sitemap Checker to analyze your sitemap.xml. The tool checks:
- Whether the file is available at the standard URL
- Whether the XML structure is valid
- The number of pages in the sitemap
- Whether the URLs and dates are correct
FAQ
Does a small website need an XML Sitemap? It is recommended for all websites. Even for a site with 10 pages, a sitemap speeds up indexing and gives search engines accurate information about when pages were updated.
How many URLs can one file contain? A maximum of 50 000 URLs or 50 MB per file. If you exceed these limits, use a Sitemap Index.
Should I add every page to the sitemap? Only include pages you want indexed. Do not include pages with noindex, duplicate URLs, pages with 4xx/5xx status codes, or technical pages.