Website Spec
← SEO
Optional

Image and video sitemap extensions

Optional XML extensions that add image and video metadata to sitemap entries. Useful when media is loaded by JavaScript or hosted on a CDN that crawlers cannot reach by following links.

What it is

Sitemaps support extensions for declaring images and videos associated with each page. They use additional XML namespaces alongside the standard urlset.

<?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://example.com/articles/csp</loc>
    <image:image>
      <image:loc>https://cdn.example.com/csp-hero.jpg</image:loc>
    </image:image>
    <image:image>
      <image:loc>https://cdn.example.com/csp-diagram.png</image:loc>
    </image:image>
  </url>
</urlset>

The video extension is similar (xmlns:video) and supports more metadata: title, description, thumbnail_loc, content_loc, and player_loc.

Why it matters

Crawlers normally find images by parsing the HTML of pages they fetch. That is usually enough. The extensions only earn their keep when:

For most marketing sites, plain <img> and <video> elements with good alt text and <source> declarations are enough. The extensions are an optimisation, not a baseline.

How to implement

For images:

For videos:

For both, prefer to add them to existing page sitemaps rather than create a separate image or video sitemap. That keeps the relationship between page and media explicit. If volume is too high, split into a dedicated sitemap-images.xml and reference it from your sitemap index.

Common mistakes

Verification

Sources