Bringing it all together

You should include all relevant XHTML, image, and video elements within their corresponding <url> tag.

For instance, /foo.html contains one image and a mobile alternate, a regional alternate, and a regional mobile alternate, /foo-two.html has two regional alternates and a video.

<?xml version=“1.0” encoding=“UTF-8”?>
<urlset xmlns=“” xmlns:xhtml=“” xmlns:image=“” xmlns:video=“” >

    <xhtml:link rel=“alternate” media=“(max-width: 640px)” href=“ foo.html” />
    <xhtml:link rel=“alternate” hreflang=“de” href=“” />
    <xhtml:link rel=“alternate” hreflang=“de” media=“(max-width: 640px)” href=“” />
        <image:caption>Waterfall in Niagara</image:caption>

    <xhtml:link rel=“alternate” hreflang=“de” href=“” />
    <xhtml:link rel=“alternate” hreflang=“nl-be” href=“” />
        <video:player_loc allow_embed=“yes” autoplay=“ap=1”></video:player_loc>
        <video:title>Grilling steaks</video:title>
        <video:description>Get perfectly done steaks every time</video:description>


Acceptable Date Values

Anywhere a date is used in an XML sitemap, it should be in the format ‘YYYY-MM-DDThh:mm:ss+TZD’ (the time is optional)

Valid examples:

  • 2014-07-16T19:20:30+08:00
  • 2014-07-16

Maximum Entries

XML sitemaps are limited to 50, 000 URLs each (or 10MB when decompressed) – when sitemaps reach more than this you should segment them by the sections of your site or into 50k/10MB segments, then reference them all in a sitemap index file (which then gets submitted to search engines and included in the robots.txt).