Comprehensive Guide to XML Sitemap Protocols & Validations
XML Sitemaps act as a blueprint for search engine bots (like Googlebot and Bingbot). They tell search crawlers exactly which pages on your website are high-priority, when they were last updated, and how often they change. Submitting a corrupted or improperly formatted sitemap can waste your site's crawl budget, lead to search indexing drop-offs, or cause crawlers to reject your index files completely.
Understanding the XML Sitemap Protocol Tags
The official Sitemap Protocol defines several core elements under the http://www.sitemaps.org/schemas/sitemap/0.9 namespace:
- <loc>: The absolute destination URL of the page. It must begin with
httporhttpsand match your domain schema. - <lastmod>: The last modification timestamp formatted in W3C Datetime syntax (e.g. YYYY-MM-DD). This informs crawlers whether a page needs to be re-scanned.
- <changefreq>: How frequently the page is likely to change (e.g.
always,hourly,daily,weekly,monthly,yearly,never). Note that this serves as a hint, not a strict command. - <priority>: The priority of the URL relative to other pages on your site, ranging from
0.0(lowest) to1.0(highest). The default priority is0.5.
Advanced Sitemap Namespace Extensions
For specialized media formats, Google supports namespaced extensions that can be embedded directly inside standard sitemap <url> blocks:
- Google Image Sitemaps (
image:image): Helps Google discover graphics, infographics, and photos that might otherwise be hidden by JavaScript loaders. It requiresimage:loc. - Google Video Sitemaps (
video:video): Allows video files to appear in Google Video search results. Requiresvideo:thumbnail_loc,video:title, andvideo:description. - Google News Sitemaps (
news:news): Essential for news publishers to get articles listed inside Google News feeds. Must contain publication name, language, date, and title. - Hreflang Alternate Links (
xhtml:link): Informs search engines about language or regional variants of a URL to serve the correct version to global searchers.
Common Sitemap Failures & Formatting Mistakes
When auditing your website sitemaps, look out for these frequent mistakes:
- Relative URL Paths: All URLs must be absolute. Writing
<loc>/about</loc>will fail parsing. - Mixed Protocols (HTTP/HTTPS): Sitemaps should consistently list HTTPS versions of URLs. List only canonical URLs; avoid redirect loops or non-canonical redirects.
- Namespace Declarations: When using image, video, news, or XHTML tags, you must declare their respective XML schema namespace prefixes on the root tag.
- Sitemap Index Directive Errors: Priority and changefreq tags must only reside in URL sitemaps. Placing them inside sitemap index files is disallowed.