How To Generate Rich Snippets In Serp For Videos Hosted On YouTube


December 3, 2012 by Baawraman

We can use Semantic Markup for videos in order to generate rich snippets for the videos easily if the video is hosted on our own server, but the same is not possible if you are using videos from Video hosting websites. But, if you are using videos on your website which are hosted on YouTube, then you have to embed those videos on your website through the code provided by Youtube, make sure not to use iframe embedded code, use traditional one.

Here is an sample code provided by YouTube(Click Image to Zoom) .


Embedded Code (Traditional)

We need to find out below properties from this code:

media:video –> A URL to the video you wish to be displayed when the user clicks the “play” button.

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

Also, 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.  Here is the trick, in order to find out the path to the image thumbnail, follow below steps.

1. The Thumbnail url will be with the ID of your video

2. You just need to enter the ID of your video here. You can find the id of the video from the embed scr section of the above code, the embed url is

3. The / or = after the “v” is always the first delimiter, and the “?version=3&” is always the second delimiter. Everything in between is the video ID. In other words,

4. In the above url, your Id is 6mZShors3o0, which is marked in Red in the above code. So, the thumbnail url would be

Note: This thumbnail URL will be useful in creating video sitemaps for such videos as well. You can use

The media:video url will be the url which contains the video id, i.e,

Now we have media:video url and thumbnail url. We will now create the RDfa markup code(You can use Microdata as well); the equivalent RDFa code for the video would be like this(Click Image to Zoom):

rdfa for videos

Marked-up code

And that’s all. With above code along with video sitemap, you can generate rich snippets for the videos hosted on Youtube.


15 thoughts on “How To Generate Rich Snippets In Serp For Videos Hosted On YouTube

  1. Pete Kici says:

    I sent you a connection request on linkedin your profile name is different then here either way I really like what your doing very cool.I will go and try to put one together for a video and if I have questions would it be alright to contact you with questions?

    • Baawraman says:

      Thanks Pete for the request on LinkedIn, my profile url is: . If You have any further doubts, i will try to sort them out. Re sitemaps for YouTube, its always better to tell search engines where your files are located, either a xml, html, image, ror or a video sitemap. If you are providing the best of information about your content in sitemaps, Google will be able to generate rich snippets for your video content. Having said that, neither of above guarantees a rich snippet, we are just following best practices.


  2. Pete Kici says:

    Not sure if my last comment stuck so here it is again I think your doing some very cool stuff that is sure to get your video ranking but if I am hosting on you tube what is the point of a video site map?

  3. Hi Salik, this is good information. Ideal for a technical perspective (I’ll have my web guys/studio look into it. Have you tested it on vimeo? thank you.

    • Baawraman says:

      Hi Maureen,

      Thanks for your kind words. Unfortunately, Vimeo doesn’t provide embedded code in “object & param ” mode , but in iframe mode, due to which we cant use semantic markup. YouTube’s default embedded code is in iframe as well, but we can customize it and can use old traditional code.



  4. stefano says:

    Congratulations for the article, I tried to directly copy your code and put it on a page fattac on Joomla but then when I go to the front end, nothing is displayed, if I look in the html code is all correct, but the front end does not appear on video .
    What’s wrong?
    thanks a lot


    • Baawraman says:

      Hi Stefano, these tags are meta properties, so these tags will not appear on the front end .Once you add these tags, you need to check these tags using Google’s Rich Snippet Tool: , if you have added these tags properly, you’ll be able to see the added meta data with Videos. You can contact me directly to discuss this further, find my contact information About Me page.


  5. stefano says:

    Hello and thanks for asking Baawraman, see the link C3% A0.html
    in the html code see the code I posted, but do not see the video, why?
    I also took the control from the link that you’ve been through but I nenahce he sees the markup
    thanks a lot


  6. Baawraman says:

    You have used rmlns instead of xmlns in below line:

    rmlns:media=”” rmlns:dc=””>

  7. Asking questions are genuinely fastidious thing if you are not understanding something entirely, except this
    post provides nice understanding even.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: