XML Sitemap for a Website
An XML sitemap is a file that tells search engine crawlers which pages exist on your site, making it easier for them to discover and index your content — especially for pages that aren't well-linked internally. While modern search engines can discover pages through link following, a sitemap provides a reliable, structured inventory that ensures every page gets crawling consideration regardless of how it's linked. This example shows a four-URL sitemap with the standard sitemaps.org namespace (xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"), which is required for Google and other major search engines to accept the file. Each URL entry has a loc element with the absolute URL (required), a lastmod date in ISO 8601 format (optional but recommended), a changefreq hint (optional), and a priority value from 0.0 to 1.0 (optional). The priority and changefreq fields require nuance: Google has publicly stated that it largely ignores changefreq and treats priority as a relative hint rather than a strict instruction. A blog page with priority="0.9" and changefreq="daily" won't necessarily be crawled daily or more often than a page with priority="0.5". Google determines its own crawl frequency based on historical change patterns, page authority, and budget. Despite this, including these fields is still recommended for other search engines (Bing, Yandex, Baidu) that may weight them differently. lastmod is the most useful field for encouraging recrawling: when lastmod is accurate and reflects the actual last modification date of the page's content, crawlers can efficiently decide whether to re-crawl a page or skip it if the cached version is still current. Incorrect or stale lastmod dates (always set to today, or never updated) reduce the signal's value and may cause crawlers to ignore it. Sitemap size limits: a single sitemap file can contain at most 50,000 URL entries and must not exceed 50 MB uncompressed (but can be gzip compressed). Large sites use a sitemap index file that references multiple sitemap files, each covering a different section of the site (blog, products, landing pages). Specialized sitemaps: Google supports extensions to the base sitemap format for images (image:image elements within URL blocks), videos (video:video elements), and news (news:news elements). These extensions help the corresponding Google search verticals discover your media content. Tips: reference your sitemap in robots.txt with Sitemap: https://example.com/sitemap.xml so all compliant crawlers discover it automatically. Submit it explicitly to Google Search Console and Bing Webmaster Tools to confirm it's been accepted and to see crawl coverage reports.
<?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-04-01</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/about</loc>
<lastmod>2026-03-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://example.com/blog</loc>
<lastmod>2026-04-01</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://example.com/contact</loc>
<changefreq>yearly</changefreq>
<priority>0.5</priority>
</url>
</urlset>FAQ
- Does Google use priority and changefreq?
- Google largely ignores changefreq and priority as ranking signals, preferring its own crawl frequency determination. Include them for other search engines, but do not rely on them to influence Google crawl rates.
- How do I handle image and video sitemaps?
- Google supports image and video sitemap extensions using additional XML namespaces. Add the image: namespace and include <image:image> elements within each <url> block to help Google index your media.
- Where do I submit my XML sitemap?
- Submit via Google Search Console under Sitemaps, and reference it in your robots.txt file with Sitemap: https://example.com/sitemap.xml so all crawlers can discover it automatically.
Related Examples
RSS feeds enable content syndication that puts your readers in control: they sub...
SVG Icon XML StructureSVG icons are XML documents that scale to any size without pixelation, can be st...
SOAP Request Envelope XMLSOAP (Simple Object Access Protocol) is the XML-based messaging protocol that do...