Disable related videos on a embedded Youtube player

Last updated on Sun, 2010-06-06 09:59. Originally submitted by fabio on 2007-08-23 12:19.

Youtube recently added a new feature to the video player used to embed Youtube videos on other website.

The new default player, once the video completes playing, will display a list of related videos.

While this feature could be useful for some users it is probably not wanted on Youtube video aggregation websites.

Fortunately it's possible to disable related videos.
Let's see how.

The default player

Let's take a cool video (I'm a windsurfing addicted).

The default embed code Youtube suggest us is

<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/Yc_J_kXaFSw"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/Yc_J_kXaFSw" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
</object>

Which will generate this:

As you can see, at the end of the video the player will display something like this:

Youtube related videosYoutube related videos

Disabling related videos

The trick is to attach to the player URL (http://www.youtube.com/v/Yc_J_kXaFSw) the rel=0 parameter.

The player URL will became http://www.youtube.com/v/Yc_J_kXaFSw&rel=0

Just update the embed code with the new URL:

<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/Yc_J_kXaFSw&rel=0"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/Yc_J_kXaFSw&rel=0" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
</object>

The player now looks like:

We don't have more related videos!

Let's use valid XHTML code

Unfortunately the embed code provided by Youtube isn't valid XHTML code and does not pass the W3C's XHTML validation.

This is really bad as creating valid XHTML web pages is valuable and professional. In some countries it is even required by law for public administration websites.

So we can use something like

<!--[if !IE]> <-->
<object type="application/x-shockwave-flash" width="425" height="350"
data="http://www.youtube.com/v/Yc_J_kXaFSw&rel=0">
<!--> <![endif]-->
<!--[if IE]>
<object type="application/x-shockwave-flash" width="425" height="350"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<![endif]-->
<param name="movie" value="http://www.youtube.com/v/Yc_J_kXaFSw&rel=0" />
<p>Your browser is not able to display this multimedia content.</p>
</object>

The above code, which come from my Drupal video module, is valid XHTML code and works with the most used web browsers.

The above code generate:

Your browser is not able to display this multimedia content.

Conclusions

You are now able to control the behavior of Youtube player related video and post on your website Youtube videos following XHTML standards.

References

New! Related Videos Appearing on Embeds at Youtube Blog

Posted in:

thnks....

Submitted by Manisha Sherla (not verified) on Fri, 2010-07-30 10:31.

thanku for this article....

Thank you very much for your

Submitted by Malid (not verified) on Thu, 2010-07-01 01:36.

Thank you very much for your post.

great

Submitted by Soko Banja Apartmani (not verified) on Wed, 2010-06-30 00:36.

this is great, thanks

disabling related videos

Submitted by Tom (not verified) on Sun, 2010-06-06 01:41.

Excellent. Many thanks for that, extremely irritating YouTube feature disabled on my blog.

Banja Vrujci Video

Submitted by Banja Vrujci (not verified) on Sun, 2010-05-23 18:44.

Thank you for this very useful tip, i dont like these "related videos" at all. Also i have some clips from youtube on my site http://www.banjavrujci.info/smestaj/video and i am going to put your code to disable related videos. Thank you once again

Great blog - Awesome!

Submitted by Brent Lane (not verified) on Thu, 2010-04-29 00:09.

Hey thanks for making that quick and easy tutorial blog. I really rely on things like this for my learning curve. I did just made the changes to my video at http://www.brentlane.com it's right no the front page. We used green screen actually ($.50 poster board scotch taped together) and then did some pretty neat stuff in the video. Check it out if your interested.

Once Again thanks for the blog post. It was clean, concise, and most importantly was the first one I found. I am going to link to this blog post from mine on the site. Cheers.

apartmani

Submitted by Soko Banja (not verified) on Wed, 2010-04-21 09:40.

Great tips. Thanx. Very useful

Thank you for the tips!

Submitted by Eaindra (not verified) on Wed, 2010-03-31 10:48.

Thank you for the tips!

Remove embedded youtube video

Submitted by Anonymous (not verified) on Mon, 2010-03-08 04:54.

Can someone tell me how to remove my embedded youtube video from my wordpress front page.

Thanks for the tip

Submitted by Nitin (not verified) on Sat, 2010-02-20 11:12.

Thank you for the excellent tip.

Disable Youtube click through

Submitted by Anonymous (not verified) on Mon, 2010-02-08 16:16.

is it possible to disable a CLICK through to the YOUTUBE site when an embedded video is playing.

i.e. prevent a user such as a child going direct to Youtube?

I'm looking for the

Submitted by Anonymous (not verified) on Wed, 2010-03-31 21:22.

I'm looking for the same!
Anybidy knows how t do this?

I just want to say....

Submitted by Chris Michael (not verified) on Sun, 2010-01-10 03:19.

THANK YOU MAN!

Cheers :)

Graviranje i secenje

Submitted by Graviranje (not verified) on Tue, 2010-01-05 07:31.

Excellent, but anyway I wanted to find somewhere a way to not appear different clips.

&rel=0

Submitted by From brazil (not verified) on Mon, 2010-01-04 20:56.

Sweet tip!!!

tks

Thanks for help - great advice!

Submitted by visitorWeb (not verified) on Wed, 2009-12-16 20:03.

You saved me a lot of time. I started to thing about posting video on some other site instead Youtube - but thanks to you - it is all fixed now.
Works great!

You tube and W3C validation

Submitted by Greeny (not verified) on Fri, 2009-12-11 17:24.

I think you joke.. tell me where why your code is not validating:

...
Please try this link to see tell me where I wrong:
http://www.validome.org/xml/validate/
Anyone has the Answer but which is that??
Thank you

clever trick

Submitted by Bob Xin (not verified) on Fri, 2009-12-11 15:58.

Actually, I am doing some gray hat technique for youtube videos. I know they can be banned any time. But a lots of thanks to you coz now I am sure that I won't get banned to disable those videos.

Till now I was using youtube videos in my own player.

grad

Submitted by Loznica (not verified) on Thu, 2009-12-10 12:27.

Thank you very much, this is really to use due to competition....

I'm still having problems

Submitted by Help (not verified) on Wed, 2009-11-25 21:18.

Here is my embedded info where do I place the rel=0?

Thank you so much for your help

Hi, Thanks a ton. It really

Submitted by Ram (not verified) on Tue, 2009-11-17 07:15.

Hi,

Thanks a ton. It really helped save lot of time.....

Thankyou worked a treat!

Submitted by Moonbeam (not verified) on Tue, 2009-11-10 14:04.

Thankyou worked a treat!

Thanks

Submitted by Puneet (not verified) on Tue, 2009-10-06 19:13.

Thanks for the information man. Saved lot of time.

Ok, successful for my facebook page...

Submitted by Anonymous (not verified) on Mon, 2009-09-07 14:56.

Posted a clip of my kids and an sexy video is related... I was able to remove the related video on my facebook but if people go directly on youtube, they will see the related video still.... I changed the category, changed the description so any word could be seen related... But its still there, on youtube itself. Anyone knows how to have that changed?

Unfortunately the procedure I

Submitted by fabio on Mon, 2009-09-07 16:57.

Unfortunately the procedure I describe here is only for embedding videos on websites. I'm not aware of any procedure for disabling related videos on Youtube itself.

I don't know if it is possible. Anyway you can ask for help in the official Yotube forum. There you'll probably find more informations.

http://www.google.com/support/forum/p/youtube?hl=en

You Are the Man!

Submitted by SEO (not verified) on Wed, 2009-09-02 22:54.

You saved me from doing a lot of work finding a stand alone player and video hosting for a client. Once again, YOU ARE THE MAN!

Wonderful

Submitted by Al-Kanz (not verified) on Sun, 2009-08-30 23:24.

Thank you very much !

Thank you!!

Submitted by Anonymous (not verified) on Sat, 2009-08-15 01:50.

rel=0 worked great!

Postei um védio no youtube e

Submitted by Thais (not verified) on Mon, 2009-08-03 00:01.

Postei um védio no youtube e existe um vídeo indesejado relacionado ao meu. Já tentei mas não consigo extraí-lo de lá.
Ajuda ?

I'm sorry. Would you please

Submitted by fabio on Mon, 2009-08-03 22:57.

I'm sorry. Would you please ask the question in English? Not able to understand Portuguese.

Good tip

Submitted by James McWhorter (not verified) on Mon, 2009-05-25 15:25.

It's sad that we have to do this now but thank you for sharing this information. It will come in handy!

Excellent!

Submitted by David (not verified) on Sun, 2009-04-26 18:02.

Thanks for being the top "Google" search result for "remove related youtube"! Clear and easy explanation.

Thnak you. it worked , very

Submitted by Anonymous (not verified) on Sat, 2009-04-18 22:51.

Thnak you.

it worked , very nice.

Thanks! I really needed

Submitted by Anonymous (not verified) on Wed, 2009-04-01 03:12.

Thanks! I really needed this! There was an inappropriate movie right after the on I wanted that would show up as related videos.

Wordpress

Submitted by Anonymous (not verified) on Wed, 2009-03-18 20:05.

Does this work with wordpress? I have tried it but it still shows up.

thank u man i'll check it

Submitted by Anonymous (not verified) on Sun, 2009-03-15 21:44.

thank u man

i'll check it

Thanks for the TIP

Submitted by Anonymous (not verified) on Tue, 2009-02-17 14:15.

Worked great!!!!

While this feature could be

Submitted by mpcoc (not verified) on Fri, 2009-02-13 18:26.

While this feature could be useful for some users it is probably not wanted on Youtube video aggregation websites.

mpcoc

How do I remove the URL at the bottom of the embedded player?

Submitted by Anonymous (not verified) on Tue, 2009-02-10 22:15.

The HTML code provided by YouTube for a custom embedded player is generating a border at the bottom of the player that contains the link to our YouTube Profile page, e.g., youtube.com/user/name.

How can this link be removed or kept from appearing?

Have you tried using the

Submitted by fabio on Tue, 2009-02-10 23:30.

Have you tried using the code provided in the article? It does not display any username link.

You just have to copy and past the last code and substitute any occurrence of Yc_J_kXaFS with the id of your video.

eg. if your video has url (the browser address) http://www.youtube.com/watch?v=CQzUsTFqtW0 you will substitute Yc_J_kXaFS with CQzUsTFqtW0 in the last code I provided.

Hope this helps, if you still needs help just post here.

correction

Submitted by Anonymous (not verified) on Tue, 2009-02-10 22:20.

In the above question, the link was not meant to be an actual one, but it apparently links to an actual page. Please ignore the example.

I modified your comment to

Submitted by fabio on Tue, 2009-02-10 23:24.

I modified your comment to let the link disappear.

Don't Advertise For Your Competition on You Tube

Submitted by James Holmes (not verified) on Sun, 2009-02-08 20:31.

If you use You Tube to host business related videos that you then place onto your website or blog you are running a nice traffic feed for your competitors as videos with related content are offered at the end of your video. I have always suggested that my associates do not do this.

I appreciate this revelation and the specific code to solve this problem. I will put it into practice and add it to my coaching program for the people I work with in online marketing.

Great tip!

James
http://www.Twitter.com/AskJamesHolmes

I needed this!

Submitted by josh (not verified) on Fri, 2009-02-06 14:34.

Thank you so much. I've wondered for a long time whether I could do this, and I finally Googled it. So glad your (very clear) explanation was near the top.

rel=0 was useful.....

Submitted by Bincom ICT Solutions (not verified) on Tue, 2009-01-27 17:44.

Thank you... this information was extremely helpful to me....

I was trying to find how to disable the youtube related video.... and your blog was the solution i needed.

when you double click

Submitted by Anonymous (not verified) on Tue, 2009-01-06 13:23.

when you double click quickly within the video player, it brings you to the original youtube page.. is there any way to disable that? would be great

thanks

Submitted by Keyeagle (not verified) on Fri, 2008-12-26 15:29.

Thanks a Lot.This is really very useful.
keyeagle

Thanks a Lot

Submitted by Thangu (not verified) on Mon, 2008-12-15 20:13.

Thanks a Lot.This is really very useful.

Thanks so much for it! I

Submitted by KUMA (not verified) on Tue, 2008-11-11 07:12.

Thanks so much for it! I actually was able to find your site really fast :) Thank God for SEO ^^

Adjust YouTube Customised Players Alpha

Submitted by Jaffasoft (not verified) on Tue, 2008-09-30 12:02.

Can a parameter of the youtube customised player code be set to say 50% alpha so that the outer edges of the customised player will be see through but the videos that play stay normal? Please indicate how with the below code is so...

Post new comment

The content of this field is kept private and will not be shown publicly.
If you have a personal or company website insert its address in the form http://www.example.com/ .
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <del> <img> <h2> <h3> <h4> <b> <video>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.
  • You may use [inline:xx] tags to display uploaded files or images inline.
  • You may insert videos with [video:URL]

More information about formatting options