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

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.

About these ads

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

  1. Salik
    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?

    • 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. Salik
    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?

    • 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.



  3. 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


    • 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.


  4. You have used rmlns instead of xmlns in below line:

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

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s