Building a Video Sitemap

Update: JW7 is now available. Check it out here. Is your goal to increase the total number of video views on your site? Are you having trouble ranking high within search engine results? This blog post will present some basic guidelines for achieving this goal — and building a robust Video Sitemap for your site. One of the most effective ways to drive traffic to your videos, and site in general, is through the use of a sitemap, or in this case, a video sitemap. A sitemap provides search engines with information about your site, and a video sitemap provides information on your videos. In essence, it makes it easier for search engines (i.e. Google) to understand the content of your site, and assign the appropriate rankings.

Let's Start at the Beginning:

What are video sitemaps and why do you want them? A video sitemap is an XML file that tells search engines where videos can be found on a website. It helps search engines understand that it is indeed a video file, what the video content is, and what the technical specifications of the specific video are. Google recommends that you use video sitemaps for several reasons. First, you can explicitly tell Google which content you wish to be indexed, giving you more control than with an organic search algorithm. Second, and more importantly, video sitemaps allow you to choose how your videos are listed, and define what metadata is most relevant to your video, optimizing search results. How do you host and submit a video sitemap? Google only accepts video sitemaps that are hosted on the same sub-domain as the rest of your website. So, if your website is www.yourwebsite.com, you need to host your sitemap on the same domain; for example, www.yourwebsite.com/videositemap.xml. The easiest way to tell search engines where to find your video sitemap is to add the location of your video sitemap to the robots.txt file in the root of your webserver. An example video sitemap would look like this:
User-agent: *
Disallow: /admin
Sitemap: http://www.yourwebsite.com/videositemap.xml
Alternatively, you can use Google Webmaster Tools to submit your video sitemap directly to Google (Google Webmaster Tools will also validate your video sitemap). Note that you first need to register your site with Google Webmaster Tools. After doing so, within the “site details” you will find a link to "Submit a Sitemap". We recommend that you do both; other search engines (i.e. Bing) can also find an index using robots.txt, thus by submitting your sitemap you will ensure that your sitemap is valid and will be indexed.

Sitemap Structure and Semantics

Let's take look at an example sitemap that we have used, in the past, for our own website
<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9' xmlns:video='http://www.google.com/schemas/sitemap-video/1.1'>
  <url>
    <loc>http://www.bitsontherun.com/tutorials/managing-multiple-accounts/</loc>
    <video:video>
      <video:thumbnail_loc>http://content.bitsontherun.com/thumbs/yDtLAunz-480.jpg</video:thumbnail_loc>
      <video:title>Reseller overview</video:title>
      <video:description><![CDATA[Learn about the features of our dedicated reseller accounts.]]></video:description>
      <video:content_loc>http://content.bitsontherun.com/videos/yDtLAunz.mp4</video:content_loc>
      <video:player_loc allow_embed="yes" autoplay="autostart=true">http://content.bitsontherun.com/players/yDtLAunz-ALJ3XQCI.swf</video:player_loc>
      <video:duration>100.80</video:duration>
      <video:view_count>99</video:view_count>
      <video:publication_date>2010-11-12T14:41:00+00:00</video:publication_date>
      <video:tag>dashboard</video:tag>
      <video:tag>screencast</video:tag>
      <video:family_friendly>yes</video:family_friendly>
    </video:video>
  </url>
</urlset>
Some things worth noting:
  • You need to include a direct link to the video file. Google will download a part of the file and check some video metadata to verify that the content is indeed a valid video.
  • The ![CDATA[ clause in the description ensures that certain characters within the description (i.e. $ and !) won't break the sitemap XML. You can choose to leave this out, but take extra precaution with what characters you use in your description.
  • You should make use of optional tags. For example, <video:expiration_date>, which tells Google when a video will go offline, and should be unlisted from the search index. Read more here.

Sitemap Best Practices

As you work to get your content indexed in Google, keep these points in mind:
  • Make sure each video has its own page. Google likes this. Even if you embed multiple video players on other pages, or use playlists throughout your website, make sure that you have a specific page for each video and link to those pages in your video sitemaps.
  • Make sure that the title, description and tags in the headers of the page correspond with the title, description and tags of the video.
  • When you make a video unavailable, be sure that the video page listed in the sitemap returns a file not found status (HTTP 404). This tells a search engine that the video should be dropped from the index.
  • Google isn't always very good at reading complex JavaScript like the JW Player 5.4 JavaScript, which offers unified playback in both HTML5 and Flash. The best way to work around this is to include a very basic embed tag inside a noscript element that can be read by search engine crawlers. An example code would look like this:
<script type="text/javascript">
    jwplayer("container").setup({
        flashplayer: "/jwplayer/player.swf",
        file: "/uploads/video.mp4",
        height: 270,
        width: 480
    });
</script>

<noscript>
<embed
  flashvars="file=/uploads/video.mp4&autostart=true"
  allowfullscreen="true"
  allowscripaccess="always"
  id="player1"
  name="player1"
  src="/jwplayer/player.swf"
  width="480"
  height="270"
/>
</noscript>

Recommened Resources

  • Google Webmaster has a ton of information on how to create video sitemaps. They are, after all, the masters who defined the video sitemap.
  • ReelSEO is a great website that is focused on Video SEO. It contains a wealth of information about video search engine optimization and a lot of practical guides.