You are here:

Boost YouTube Videos Traffic with RDFa Rich Snippets

3.00 out of 5 based on 3 ratings. 1 user reviews.

The techniques explained in this tutorial are fully supported by Google and Yahoo, and can boost your video's visibility in their search results!

YouTube videos have worked their way into a prominent position as a tool for both content and SEO, in websites from all over the world. The convenience of being able to embed a video on webpages has given such media an important place in the marketing strategies of many sites.

Of course, the more progressive internet marketing consultants and web developers have also focused heavily upon valid code, with the best concentrating on RDFa compliance.

Imagine the disappointment of having managed to achieve perfect xml/xhtml compliance, and then finding that after adding a YouTube video to your page, you're no longer able to validate.

There's a simple reason for that, of course. The EMBED tag is not valid for XHTML. It was valid for HTML 4.01, but has since been deprecated. In XHTML, we must use the OBJECT tag for placement of multimedia on a page. YouTube does, in fact, use the OBJECT tag, but they then place the EMBED tag within it, rendering the XHTML code invalid.

Here's a standard EMBED code, provided by YouTube:

<object width="640" height="385">
<param name="movie" value="http://www.youtube.com/v/HkMFK857Glo&amp;hl=en_US&amp;fs=1"></param>
<param name="allowFullScreen" value="true"</param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/HkMFK857Glo&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed>
</object>

YouTube video with OBJECT tag for Yahoo! SearchMonkey

Properly coded markup will indicate to Yahoo! that a video exists on your page. From your markup, Yahoo will be able to extract structured data from your site and render it automatically in an enhanced fashion in their search results.

Use RDFa markup in order to allow validated embedding your videos on third-party sites, as well as to use extra features, such as regional restrictions. The site must be approved to display as a Rich Result. You should submit the domain for Yahoo consideration at hsearchmonkey-submissions (at) yahoo-inc.com.

After some slight modification, in which we eliminate the EMBED tag, we move the necessary attributes to the OBJECT tag. We also replace the SRC attribute with the DATA attribute containing the same information.

The resulting code looks like this:

<p><object width="640" height="385" type="application/x-shockwave-flash"
data="http://www.youtube.com/v/HkMFK857Glo&amp;hl=en_US&amp;fs=1" rel="media:video"
resource="http://www.youtube.com/v/HkMFK857Glo&amp;hl=en_US&amp;fs=1"
xmlns:media="http://search.yahoo.com/searchmonkey/media/"
xmlns:dc="http://purl.org/dc/terms/">
<param name="movie" value="http://www.youtube.com/v/HkMFK857Glo&amp;hl=en_US&amp;fs=1" />
<param name="allowFullScreen" value="true" />
</object></p>

YouTube video with OBJECT tag for Google

Google recognizes the following Facebook and Yahoo! SearchMonkey RDFa properties. However, you must fill out the form to indicate your interest in Rich Snippets for your site.

The following excerpt is from a Google article "Help us make the web better: An update on Rich Snippets", calls on webmasters to support this new trend:

When video content is marked up in the body of the page, search engines and other sites can recognize it and may use it to improve the display of video content on a page or in search results.

Marking up your content lets you give Google and other sites information about the content of your videos information that help determine the relevancy of your content to a search query.

Furthermore, if you decide to use Facebook Share tags on your video playpages, users will see rich annotations of your content within Facebook. Google will recognize Facebook Share and RDFa markup.

Required Properties:

media:video --> A URL to the video you wish to be displayed when the user clicks the "play" button.

xmlns:media --> Must consist of the following URL: "http://search.yahoo.com/searchmonkey/media/".

media:thumbnail --> A URL pointing to a preview thumbnail, which must be a GIF, PNG, or JPG image.

The preview thumbnail must be hosted on the same domain as the video.

YouTube does not provide an option to upload a preview thumbnail, as they create one. The preview image of the video below hosted on YouTube.

<p><object width="640" height="385" type="application/x-shockwave-flash"
data="http://www.youtube.com/v/HkMFK857Glo&amp;hl=en_US&amp;fs=1" rel="media:video"
resource="http://www.youtube.com/v/HkMFK857Glo&amp;hl=en_US&amp;fs=1"
xmlns:media="http://search.yahoo.com/searchmonkey/media/" xmlns:dc="http://purl.org/dc/terms/">
<param name="movie" value="http://www.youtube.com/v/HkMFK857Glo&amp;hl=en_US&amp;fs=1" />
<param name="allowFullScreen" value="true" />
<a rel="media:thumbnail" href="http://i1.ytimg.com/vi/HkMFK857Glo/default.jpg" />
<a rel="dc:license" href="http://www.tvspielfilm.de/services/nutzungsbedingungen/agbnutzungsbedingungen,3711440,ApplicationArticle.html" />
<span property="dc:description" content="Sie lieben Filme? Wir auch!" />
<span property="media:title" content="Tv Spielfilm: Sie lieben Filme? - 6" />
<span property="media:width" content="640" />
<span property="media:height" content="385" />
<span property="media:duration" content="15" />
<span property="media:type" content="application/x-shockwave-flash" />
<span property="media:expirationDate" content="2032-08-19" />
<span property="media:region" content="de" />
<span property="media:region" content="at" />
<span property="media:region" content="ch" />
</object></p>

The code for the thumbnail for this example is: http://i1.ytimg.com/vi/HkMFK857Glo/default.jpg. In order to modify this to display the thumbnail for the video you intend to embed, simply replace the specific video ID, shown here in red:

http://i1.ytimg.com/vi/HkMFK857Glo/default.jpg with the ID of your video, which is that shown here as ***, between the / and the ampersand (&amp;):http://www.youtube.com/v/***&amp;hl=en_US&amp;fs=1.

The / or = after the "v" is always the first delimiter, and the "&amp;" is always the second delimiter.

Everything in between is the video ID. In other words, http://www.youtube.com/v/VIDEOID&amp;hl=en_US&amp;fs=1. Note in the example above, that <span property="media:region" content="de" /> has been set for Germany, as well as the regional codes for Austria and Switzerland, which follow it. This property can be added for several different regions or for only one, as desired.

It's important to remember that the EMBED code offered by YouTube is still their original, non-valid code. You'll need to modify it as shown above, for each video you want to embed.

Both methods are equally functional, across various browsers and operating systems. However, only these examples will validate as proper XHTML. Wouldn't you prefer to maintain your pages' validation?

It's no small benefit, either, that this change to your embedding technique will allow better visibility in the social search arena, which appears to be rapidly becoming the central driving force of web search.

About this SEO tutorial

This tutorial was written by , Forensic SEO & Social Semantic Web Consultant at SEO Workers and was published August 03, 2010.

Copyright reserved. Not to be reproduced.

Comments & Ratings

Boost YouTube Videos Traffic with RDFa Rich Snippets Tammy 3 stars 2010-09-24 13:17:18 Doesn't the URL of the thumbnail need to come from the same domain as the video?


Attention Comment Spammers!

  • Google says that spamming other sites can lower your site rankings;
  • Signature links under comments are not accepted;
  • Highly relevant links in the body such as the web site or blog URL are allowed, but only upon our approval;
  • You can expect that your comment may be deleted if you are attempting to get a backlink link rather than adding real value to the conversation;
  • SEO or Link Builders, if we catch you commenting but linking to a client's site, your online reputation, your firm's and that of your client are being put at severe risk;
  • Link to a page or a blog that can be identified as being about you, so our readers can gain additional perspective on your point of view and where necessary sufficient disclosure.
Comment & Rate