SEO

Video Sitemap: XML Schema, Best Practices & Examples

Create a video sitemap to help search engines find and index content. This guide covers XML tags, metadata requirements, and best practices.

590
video sitemap
Monthly Search Volume
Keyword Research

A video sitemap is an XML file that extends a standard sitemap to include metadata about videos hosted on your pages. It helps Google find and understand video content, especially newly added videos or content that standard crawling might miss. Creating one increases your chances of appearing in video-specific search results and can improve click-through rates by enabling rich visual snippets.

What is Video Sitemap?

A video sitemap uses the standard sitemap schema as its base and adds video-specific tags in the namespace http://www.google.com/schemas/sitemap-video/1.1. You can create a separate file just for videos or embed video tags within an existing XML sitemap. Each entry identifies the landing page where the video appears and provides descriptive metadata like thumbnails, titles, and duration. Google also supports mRSS feeds as an alternative format for submitting video metadata.

Why Video Sitemap matters

  • Capture video search visibility: [Videos appear in 72.2% of search results in America] (Blue Billywig), providing visual breaks from text results that can improve click-through rates.
  • Control indexing location: When videos appear on multiple pages, the sitemap specifies which landing page Google should index and display in results.
  • Accelerate content discovery: Helps Google find videos that are recently added or hidden behind JavaScript that standard crawling might not discover.
  • Enable rich results: Supplies thumbnails, durations, ratings, and metadata required for video-rich snippets in search results.
  • Support platform restrictions: Allows you to specify geographic or device-specific availability (web, mobile, TV) directly to search engines.

How Video Sitemap works

  1. Create the XML structure: Use the video namespace within a standard <urlset> or <rss> container. Each video requires a parent <url> tag containing <loc> (the page URL) and nested <video:video> elements.
  2. Include required tags: Add <video:thumbnail_loc> for the preview image, <video:title> and <video:description> (maximum [2048 characters] (Google Search Central)), and either <video:content_loc> (direct file URL) or <video:player_loc> (player URL).
  3. Add optional metadata: Include duration ([1 to 28800 seconds] (Google Search Central)), expiration dates, ratings (0.0 to 5.0), view counts, or restriction tags for geography and platforms.
  4. Ensure accessibility: Verify that Googlebot can access all URLs without login, firewall blocks, or robots.txt restrictions. Use HTTP or FTP protocols only; streaming protocols are not supported.
  5. Submit and maintain: Submit via Google Search Console and update when content changes. For recurring videos at the same URL, update the expiration date to the new date.

Video Sitemap vs mRSS

Feature Video Sitemap mRSS Feed
Base format XML sitemap extension RSS 2.0 module
Namespace http://www.google.com/schemas/sitemap-video/1.1 http://search.yahoo.com/mrss/
When to use Standard website video indexing Syndication and media-focused distribution
Key tags <video:video>, <video:content_loc> <media:content>, <media:player>
Size limits [Less than 50,000 videos and 50MB per file] (Blue Billywig) Standard RSS size constraints

Best practices

  • List videos only on their primary landing pages: Don't include videos that are small addendums or unrelated to the main page content. This ensures Google indexes the video in proper context.
  • Verify accessibility before submitting: Ensure all URLs in <content_loc> and <player_loc> are accessible to Googlebot without metafiles, login requirements, or firewall blocks. If restricting access, [verify that bots are really Googlebot] (Google Search Central).
  • Automate generation for large libraries: If you host thousands of videos, use your CMS API to fetch video metadata and generate the XML automatically rather than compiling by hand. Convert duration values from milliseconds to seconds during this process.
  • Use player_loc for embeds: When using YouTube, Vimeo, or other iframe embeds, use <video:player_loc> rather than <video:content_loc>. For direct MP4 files hosted on your server, use <video:content_loc>.
  • Manage file size limits: [Keep individual sitemaps under 50,000 video items and 50MB] (Blue Billywig). If you exceed these limits, create multiple sitemaps and use a sitemap index file.
  • Update expiration dates for live content: For recurring events using the same URL, update the <video:expiration_date> to the new date after each occurrence to maintain search visibility.
  • Respect character limits: Keep uploader names to [255 characters maximum] (Google Search Central) and tags to [32 per video] (Google Search Central).

Common mistakes

  • Mistake: Blocking video URLs in robots.txt while including them in the sitemap. Fix: Remove the disallow rule or remove the entry from your sitemap. Googlebot must crawl all referenced files.
  • Mistake: Using streaming protocols like RTMP in <content_loc>. Fix: Use HTTP or FTP protocols only. Streaming protocols are not supported for sitemaps.
  • Mistake: Setting duration values outside the 1-28800 second range or submitting millisecond values directly from CMS APIs. Fix: Convert milliseconds to seconds and validate the range before submission.
  • Mistake: Including HTML pages or Flash files in <content_loc>. Fix: This tag requires a direct link to the video media file in a supported format. Use <player_loc> for player pages.
  • Mistake: Exceeding the 32-tag limit per video. Fix: Count your <video:tag> elements and remove excess tags; only the first 32 are processed.

Examples

Example 1: Basic video sitemap with full metadata

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 
        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
  <url>
    <loc>https://example.com/videos/grilling-tutorial.html</loc>
    <video:video>
      <video:thumbnail_loc>https://example.com/thumbs/123.jpg</video:thumbnail_loc>
      <video:title>Grilling steaks for summer</video:title>
      <video:description>Alkis shows you how to get perfectly done steaks every time</video:description>
      <video:content_loc>http://streamserver.example.com/video123.mp4</video:content_loc>
      <video:player_loc>https://example.com/videoplayer.php?video=123</video:player_loc>
      <video:duration>600</video:duration>
      <video:publication_date>2024-01-15T10:00:00+08:00</video:publication_date>
      <video:family_friendly>yes</video:family_friendly>
    </video:video>
  </url>
</urlset>

Example 2: YouTube embed using player_loc

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 
        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
  <url>
    <loc>https://example.com/videos/cheese-tutorial.html</loc>
    <video:video>
      <video:thumbnail_loc>https://example.com/thumbs/345.jpg</video:thumbnail_loc>
      <video:title>John teaches cheese</video:title>
      <video:description>John explains the differences between a banana and cheese</video:description>
      <video:player_loc>https://www.youtube.com/embed/1a2b3c4d</video:player_loc>
    </video:video>
  </url>
</urlset>

Example 3: mRSS feed alternative

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>Example MRSS</title>
    <item>
      <link>https://example.com/video-page.html</link>
      <media:content url="https://example.com/video.mp4" 
                     duration="120" medium="video">
        <media:player url="https://example.com/player.swf" />
        <media:title>Grilling Tutorial</media:title>
        <media:description>Learn to grill</media:description>
        <media:thumbnail url="https://example.com/thumb.jpg" />
      </media:content>
    </item>
  </channel>
</rss>

FAQ

Do I need a video sitemap if I already use VideoObject structured data? Not necessarily, but it helps. Video sitemaps and structured data serve similar purposes, but sitemaps can help Google find videos that crawling might miss. If you choose one, Google recommends sitemaps, though either can work. Some sites use both for redundancy.

Can I include embedded YouTube videos in my video sitemap? Yes. Use the <video:player_loc> tag with the embed URL (e.g., https://www.youtube.com/embed/VIDEO_ID) instead of <video:content_loc>. This applies to Vimeo and other iframe-based embeds as well.

What happens if I don't include an expiration date? Omitting the <video:expiration_date> tag means Google assumes the video does not expire. If you include it, Google will stop showing the video in search results after that date. For recurring videos at the same URL, update this date to the new expiration to maintain visibility.

How do I handle the same video appearing on multiple pages? Specify the canonical landing page in the <loc> tag of the sitemap entry. This tells Google which page to index and display in search results, preventing duplicate content issues and ensuring traffic goes to your preferred page.

Why isn't my video appearing in search results after submitting the sitemap? Check three things: verify Google can access the video file (not blocked by robots.txt or login), confirm you're using supported protocols (HTTP/FTP, not streaming), and ensure the thumbnail meets Google's requirements. Use Google's Structured Data Testing Tool to verify the markup.

When should I use content_loc versus player_loc? Use <video:content_loc> when linking directly to video files (MP4, etc.) hosted on your server. Use <video:player_loc> when the video requires a player, such as embedded YouTube videos or JavaScript players. You must provide at least one of these, but you can provide both.

Start Your SEO Research in Seconds

5 free searches/day • No credit card needed • Access all features