You are here:

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=";hl=en_US&amp;fs=1"></param>
<param name="allowFullScreen" value="true"</param>
<param name="allowscriptaccess" value="always"></param>
<embed src=";hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed>

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)

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=";hl=en_US&amp;fs=1" rel="media:video"
<param name="movie" value=";hl=en_US&amp;fs=1" />
<param name="allowFullScreen" value="true" />

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: "".

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=";hl=en_US&amp;fs=1" rel="media:video"
xmlns:media="" xmlns:dc="">
<param name="movie" value=";hl=en_US&amp;fs=1" />
<param name="allowFullScreen" value="true" />
<a rel="media:thumbnail" href="" />
<a rel="dc:license" href=",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" />

The code for the thumbnail for this example is: 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: with the ID of your video, which is that shown here as ***, between the / and the ampersand (&amp;):***&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,;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 John S. Britsios (aka Webnauts), Search Experience Consultant at SEO Workers and was published August 03, 2010.

Copyright reserved. Not to be reproduced.