Embedding YouTube Videos as Valid XHTML 1.0

Album Cover: Vitalogy

"Wait for signs, believe in lies, to get by, it's divine."
Pearl Jam / Tremor Christ

Posted on May 29, 2006 4:32 PM in Web Development
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

If you've ever validated an otherwise XHTML 1.0 compliant website that embedded a video from YouTube, you've probably seen validation errors related to YouTube's use of the <embed> tag, which has been deprecated in XHTML 1.0.

If you're looking to embed a YouTube video in your website's code and want to retain your validity, instead of using their suggested format:

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

Use the following format:

<object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/7_6B6vwE83U"><param name="movie" value="http://www.youtube.com/v/7_6B6vwE83U" /></object>

You'll notice that the new format leaves out the <embed> tag and still functions correctly when embedded in your web page.

Props to the K2 Community Forums for pointing me to the Spanish explanation of this technique.


minghong on May 30, 2006 at 11:54 PM:

height and width attributes are prefectly fine in the object element, even for XHTML 1.1, see http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_objectmodule

So one should instead write the following:

<object type="application/x-shockwave-flash" width="425" height="350" data="http://www.youtube.com/v/7_6B6vwE83U"><param name="movie" value="http://www.youtube.com/v/7_6B6vwE83U" /></object>


Will Pritchard on August 24, 2006 at 3:55 PM:

Thanks for the tip mate. Saved me at least 30 minutes worth of pouring through the W3 specs looking for the correct codebase.

Also -

So one should instead write the following . . .

Either way is correct by the way. It is a matter of using CSS to define the paramater versus attributes within the object tag.


TOFUmonkey on October 11, 2006 at 9:50 PM:

hey thanks for the help!

I was pouring over the different sources trying to look for plugins and codes and files.

Didn't know by using another code, it solves the problem!
woo hoo! i'm so happy! :)

My first youtube video at www.RisingIMStar.com

Thanks alot! :)


alex sin on October 12, 2006 at 9:40 AM:

Hi Bernie

Thanks for the code. Really appreciate your effort.

Well, you heard of the latest Google deal right?

Here it is www.alexsintq.com



Mike Hunt on November 25, 2006 at 9:00 AM:

Will, TOFU: I think you'll find it's "poring" although if either of you has noticed sparks and smoke coming from your monitor, and it also seems to have stopped working, then perhaps "pouring" was the correct term after all ...



Fred Campbell on December 27, 2006 at 3:01 AM:

Thanks that's brilliant. Been looking at all sorts of mind bending solutions with reams of code. This is short, simple and sweet.


Felipe on January 01, 2007 at 11:33 AM:

Thanks a lot! i was just looking for this and it works perfectly!


Baggas on January 23, 2007 at 5:13 AM:

Thanks for the tip mate. Was struggling to work out why the YouTube standard code wasn't working in my Wordpress blog. This solved the problem right away.
Cheers :)


anakin on January 26, 2007 at 3:09 AM:

// i'm from Turkey, sorry for my english :(

I use this code for valid xhtml coding for a long time...
width="383" height="39" title="www.huseyindeniz.net">

<param name="movie" value="../images/yazi.swf" />
<param name="quality" value="high" />
<param name="Menu" value="0" />
<param name="WMode" value="Transparent" />
<param name="swliveconnect" value="true" />
it works on all browsers but a new problem occured.
If a preloader exists in flash, that preloader does'nt work on IE7

in my website (www.huseyindeniz.net) there is no preloader and it works
but in www.yazkardesim.com a preolader exists in flash and do not work on IE7. so i use embed tag and it works on ie7. i think there is a problem between ie7, object tag and flash preloading functions. Is there any solution for this problem.
// Sorry for my english again, i hope you understand my problem :)


nogg3r5 on January 28, 2007 at 6:42 AM:

Thanks for this. Awesome-ly helpful.

YouTube videos have been the thorn in my valid side for a while now!


Sigurd on January 28, 2007 at 1:51 PM:

This code works fine, but there is a white edge around the player. I solved that using this code:

<object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/ulakMBcqyPo"><param name="movie" value="http://www.youtube.com/v/ulakMBcqyPo" /><param name="wmode" value="transparent"></param></object>

All I did was to add <param name="wmode" value="transparent"> to the code.


Sigurd on January 28, 2007 at 1:56 PM:

Ops... Here is the code


Jason Fisch on February 10, 2007 at 12:15 PM:

Thanks a million, worked without a problem!


GamingG on February 11, 2007 at 10:39 AM:

Internet Explorer has always had problems with supporting the standards correctly.


cribber on February 14, 2007 at 10:00 AM:

i cant thank you enough..my whole blog was based on you tube and IE was such a mess with embed code..


Matt on February 20, 2007 at 7:00 PM:

Thanks so much! I was scratching my head trying to find a valid tag for adding a gameplay video for my game off of youtube.


sat on February 28, 2007 at 3:22 AM:

Saved a lot of time...just got here via first page of google....great cool trick.....thanx for it.


ApplesH on March 07, 2007 at 6:06 AM:

Hey... Im so glad I found your site as I have been having problems with the different plugins Ive used to display youtube videos. Yours is the best method by far. Thanks!


grog_sit_reserve on May 29, 2007 at 5:00 PM:

Thanks for this. It saved me a lot of time and is so much cleaner.


Chty on June 11, 2007 at 10:48 AM:

thanks for this post, it's very useful.


Onur Buyukceran on June 18, 2007 at 4:59 PM:

Thank you for the tip, I wonder why YouTube gives us W3 invalid codes?


Edgar Franco on June 27, 2007 at 2:26 PM:

Thanks for this tip. Now Youtube videos show good using IE 7. My web site is in spanish. Gracias


TW on July 16, 2007 at 5:50 AM:

Is there a way to add code that will replace the still image that YouTube provides? Their still is a video grab and is low-res. I'd like to modify the code to make it find a JPG on my website, but then play the video from YouTube.



Jaffer Maniar on August 07, 2007 at 6:38 PM:

This is my very first time on this blog, I found you by googling "embedding youtube".

I want to exclaim that this is the most beautiful blog (by design) I have ever seen !


Thomas on August 10, 2007 at 9:08 AM:

Hey thanks for the code guys, however -

It works great in Firefox but doesn't in IE 7...

Here is my code...What am I doing wrong???

<object type="application/x-shockwave-flash" style="width:160px; height:132px;" data="http://www.youtube.com/v/g_bK1IHTr5E"><param name="movie" value="http://www.youtube.com/v/g_bK1IHTr5E" /><param name="wmode" value="transparent"></param></object>


Thomas on August 10, 2007 at 9:31 AM:

For those who were having an IE issue like I was, I figured out the perfect code that works in both IE and Firefox and is XHTML compliant:

<object type="application/x-shockwave-flash" width="400" height="329" data="http://www.youtube.com/v/g_bK1IHTr5E"><param name="movie" value="http://www.youtube.com/v/g_bK1IHTr5E" /><param name="wmode" value="transparent" /></object>


Thomas on August 16, 2007 at 3:15 PM:

By the way, my previous post addressed the issue of changing the width and height of a YouTube embedded video (aside from its default, 425x300 width and height) - apparently, when using the code given by this site, for some reason functionality is lost when a video is resized using this site's code.

The code in my previous post can be used for videos that are resized - maintaining its XHTML compliance and function in IE and Firefox.


James Forsyth on August 28, 2007 at 3:04 AM:


This is great! I use it every time.



herr_ernst on August 30, 2007 at 5:25 AM:

thanks very much!


John Shaw on September 19, 2007 at 5:34 PM:

It's good but there's a white border around the edge. Is there anyway to fix that?


Bernie Zimmermann on September 20, 2007 at 12:01 AM:

John, scroll up to Sigurd's comments and you should see how to get rid of the white border using the optional wmode parameter.


Robin on September 25, 2007 at 12:21 AM:

I'm finding this embedded code. I have got validation errors when i first embed it. But after tried your embedded code, it's work now. Thanks for your info!


Chris M on September 28, 2007 at 10:18 AM:

Helped me alot with w3c standards!


Laer Carroll on September 28, 2007 at 1:47 PM:

I want my YouTube video to automatically start playing rather than waiting for the watcher to click on the arrow button. The old way let me do that with an autoplay parameter, as shown below. How can I do what I want with the new scheme?

<embed src="http://www.youtube.com/v/S-mkR-KoPts&NR&
autoplay=1" type="app (and so on).



Laer Carroll on September 28, 2007 at 1:53 PM:

I hit the Post Comments button only once, but I got THREE darned posts!


Laer Carroll on September 29, 2007 at 5:45 AM:

I accidentally found the answer. Change the following

And thanks much Bernie. Oh, and I love the color scheme. Very easy on the eyes, and attractive.


Bernie Zimmermann on September 29, 2007 at 8:28 AM:

Thanks for posting your findings, Laer, and thanks for the compliments.


Cropeck on October 02, 2007 at 6:45 PM:

The thing is it is not work with YouTube customized player...


TheSmarty.com on October 07, 2007 at 3:57 PM:

Yes, this is one of the best features of youtube. I love it


Make money log on October 09, 2007 at 12:05 PM:

I have done your embed code to my site, it's work well. Thanks for sharing this tip!


slime.bot on October 14, 2007 at 11:16 AM:

Lets sum:

- got rid of
- got rid of white background with transparent
- got video on autaplay

problm: IE doesnt autoplay but shows no border
FF autaplays but shows white border (on non-white background)

:) help!


TheSmarty.com on October 16, 2007 at 1:43 PM:

Hmm, sometimes it says... "the member that submitted this video has disabled embedding" or something like that.

I hate it when that happens. Any ways to avoid that?


Bernie Zimmermann on October 17, 2007 at 7:19 PM:

The only way to avoid the "embedding disabled" issue, as far as I know, anyway, is to contact the person who originally submitted the video and ask them to enable embedding.


Christoph Dollis on October 27, 2007 at 8:28 AM:

You solved my problem as well. Thanks.

By the way, I love this web and form design.


Fenix Torch on October 31, 2007 at 4:43 PM:

Thank you so much.

It baffles me why sites such as youtube don't give code that will validate. My shopping cart provider does the same thing even though it would be very simple for them to fix.

My working example can be seen here:



Inge on November 04, 2007 at 6:32 AM:

Thanks for the code!


Andrew Faulds on November 04, 2007 at 1:01 PM:

Great! Thanks! It's not validness that is good, it's also a clue to my puzzle of finding the youtube video swf address!


Ravan on November 10, 2007 at 1:40 PM:

finally xhtml compliance on every page!!!

thank you VERY much Bernie :)


Ravan on November 10, 2007 at 2:59 PM:

oh, and just to share what i found to be working too:

you can even use FlashVars as a parameter like
<param name="FlashVars" value="the=variables,you=want,to=pass,to=flash" />



jhay on November 13, 2007 at 9:01 AM:



at work and in some other places, youtube website is blocked, on my website I want to put videos from my youtube account, how can i convert it to a video that everyone can access eventhough the codes are from my youtube account? not unless, I have the original mp4 video with me, how can i get the embedded codes on that one, is there a way to do that?

b. if i have a mp3 songs and want to put it in my website, how do I get the embedded codes? because i want to put music on my website.

c. what about the slideshows for my pictures? how can i get the embedded codes on this one as well


WindBlower on December 04, 2007 at 6:28 AM:

Thank you for sharing this, it is a GreaT Help!


kevin on December 19, 2007 at 2:38 AM:

Thanks, but what if i want to add some other options like play=true or menu=true?
This wont work..
Any ideas?


Mateo on December 20, 2007 at 2:00 AM:

hmmm... I was looking for a way, that's cool to validate w3c but you don't have the small preview before playing the video, and that's not really cool...


nihal on January 06, 2008 at 12:45 AM:

i embed your code, its working fine, thanks allot for sharing this Tips.


Dan Sing Underfoot on January 07, 2008 at 1:06 PM:

Thanks! I had the validation figured out but couldin't get my z-index to work properly!


ravi on January 09, 2008 at 3:13 PM:

is there anyway to remove those youtube logos from the videos while playing on my site?


David on January 11, 2008 at 11:27 AM:

Thanks, it helped me deliver a XHTML valid 3D model design site here: http://www.3dmodeldesign.co.uk


Sistereinstein on January 17, 2008 at 6:39 AM:

Good Morning,
Trying to get this object to embed correctly in DW4 and it recognizes the Activex Control but still appears as a Greg Box on the page, and online it is a white BOX. Very frustrating.

Any ideas on how I can embed this to show correctly? I am able to get it to work on the blogsite http://www.donniepick.blogspot.com but not in the website.


thedral on February 01, 2008 at 8:07 AM:



TechAdvance on February 03, 2008 at 1:05 PM:

Fantastic......... Thankyou very much!!! My Youtube videos wouldnt show in IE7 and this solved the problem 100% and i found this site in seconds ......


andrezero on February 09, 2008 at 3:47 PM:

Hi. Found your site by chance when looking for a valid xhtml way to embed google videos. I posted a link to your post as the good solution(s) within with a post about "zero errors policy" on validation over at my blog.


George Felix on February 10, 2008 at 12:37 PM:

I need to have a YouTube player that will search YouTube and will find automatically the last 20 videos that have been uploaded with a spesific key word. The player must be able to be embeded into ASP pages and PHP pages. it must look like the regular YouTube player


Matt on February 16, 2008 at 8:20 PM:

Unfortunately, it doesn't appear this method works with IE6.


BEAUTIFUL SONG on February 28, 2008 at 3:05 PM:
Judy on March 08, 2008 at 1:02 AM:

This post was of great help! I was really starting to stress out at one point with the YouTube code breaking my CSS.

Thanks, Bernie!


Wiper on March 13, 2008 at 8:01 AM:

Thanks Bernie for the code.


steve on March 16, 2008 at 6:44 PM:

Bernie, thanks for the blog post.

Thomas, thanks for the code. It worked best for me, in getting both ff and i.e. working.


BlueBerry Pick'n on March 17, 2008 at 2:18 PM:

I wish I could figure out how to encourage Serendipity to accept the code rather than formatting it as text...

Spread Love...

BlueBerry Pick'n
can be found @
"We, two, form a Multitude" ~ Ovid.
"Silent Freedom is Freedom Silenced"


metoto on March 18, 2008 at 8:52 AM:


I would really like to know why the code for an youTUBE embedded does not work on eBay auction sites is there more or less needed?


metoto on March 18, 2008 at 8:56 AM:

ok , yep it works here but not for yahoo email or some html sites either. Please someone could provide the embedded code especially for ebay.

Thanks everyone...


Florentina on March 19, 2008 at 7:22 AM:

WOW, thanks a lot! If I'd have found this sooner I woudn't have wasted 4 hours trying to figure out why it doesn't work.


Ruusvuu on March 31, 2008 at 10:38 PM:

website's in production. This was a most valuable resource as I am developing the site to be completely standards compliant.

Cheers! ;-)


Martin Nielsen on April 29, 2008 at 12:04 AM:

Incredibly this post is still highly relevant 2 years later. My solution to the problem, a php preg_replace that changes the code automatically so I can still be lazy and copy the code directly from youtube. Thanks for the post


Richard Ogima on May 11, 2008 at 1:53 PM:

Hey guys, thanks for all the help with all the codes and all. It's a pretty resourceful page. I am trying to embed code into my Facebook account. If only I could create a automatic loading video that plays when users visit my site....then again, why would uses want stuff starting up without their consent or activation....but, maybe that's what they get as the result of visiting mysite, however, I don't own Facebook, dammit.


Mahmood Ali on May 14, 2008 at 6:09 AM:

Can you get title, descrition and other details by using vedio_id of youtube.
I have vedio_id and using php 4.3 version. Please tell me, can we get the other details using vedio_id.


Hip-Hop on May 24, 2008 at 4:08 PM:

Great Share!!!!!!!!!!!!!!!!!!!!!!!!!!


Brendan on May 25, 2008 at 5:02 PM:

Thanks for the tip! Still works fine!


Lenser on June 09, 2008 at 10:31 AM:

Great information! I could kiss you.

This had been preventing me from adding videos to my sites for some time.


arijeet bannerjee on July 16, 2008 at 12:39 AM:

This piece of code was very helpful. it is working fine. saved a lot of time.

thanks buddy!!!! keep up the good work...


Betsy on July 17, 2008 at 8:52 PM:

Thanks, Bernie, for the fast and easy tip...perfect. Beautiful blog as well. Cheers to you.


freeball on August 05, 2008 at 11:42 PM:

thanks a lot for the solution! greets from romania


Will on August 27, 2008 at 7:00 PM:

Glad to see that after 2 years, this method still works. Thanks a bunch!


Jason Hubsch on September 05, 2008 at 3:28 PM:

Once again, a google search for a issue I'm encountering leads me to a Bernie solution. Thanks again!


Dan Pickett on September 19, 2008 at 11:34 AM:

Really helpful! Thank you.


Tharaka Umayanga on September 20, 2008 at 11:36 PM:

Thank You


Nick Pettit on September 26, 2008 at 11:00 PM:

My buddy Jim and I over at Done21.com noticed that a lot of people on the web were having this same problem, so we made a free tool, called Validifier, to help make it a lot easier.

Check it out at http://validifier.com/

Hope this helps someone. :D


Bernie Zimmermann on September 27, 2008 at 6:10 AM:

Pretty cool tool, Nick. Thanks for sharing the link.


BMJackal on October 27, 2008 at 3:42 PM:

Thanks a lot, really! Your code has saved me from rotting at my computer for several hours! My praises to you ;)


Vowels on November 02, 2008 at 2:50 PM:

Works great, even over two years later, but what about allowing fullscreen? With the above code, it doesn't work; when I put this into the object tag -- allowfullscreen="true" -- it's invalid again.

Oh well, more Googling to be done.


Bernie Zimmermann on November 03, 2008 at 10:38 AM:

Vowels, remember, the <param> tag is your friend. I bet if you drop the allowfullscreen/true name/value pair in one of those, you'll be golden.


Konstantin on November 05, 2008 at 7:05 AM:

By the way, this does not work with "Page Style" equals to "No Style" (this is in terms of Firefox's menus). The original YouTube code works.


Stuart Davison on November 25, 2008 at 4:59 AM:

Totally awesome - been looking for this solution for whats seems like a lifetime now. *hat tips* much respect!


virtual millenium on November 25, 2008 at 5:42 PM:

The code works fine in Firefox and IE7, the problem is that it doesn't show anything in IE6 and earlier!

so what's the solution for that?


markese on December 05, 2008 at 6:06 AM:

grazie mille. la soluzione funziona alla perfezione. grazieeeee


FIELD_NICKNAME on December 16, 2008 at 3:57 AM:



ccmee on January 15, 2009 at 9:32 PM:

It works fine in IE6 and IE5.5 so whats the problem. Thankyou for solving this problem for me.


Davetta on January 20, 2009 at 9:53 AM:

Thank you SO much for this XHTML valid YouTube code!

I was going nuts trying to validate my stepdaughter's site. :)


Thinker on January 26, 2009 at 3:44 PM:

I have a micro-blogger that I built and users can embed their own Youtube! videos. I don't want to try to change the tags programatically so that it validates. Are there any versions of HTML/XHTML that allow for Youtube! embed code to validate as it is?


Chris Stone on January 28, 2009 at 6:18 PM:

Thanks for the code! Works great! The code was used in a a site that helps musicians get back their stolen music instruments by publicizing instrument thefts to the music community. Rock on!


Bernie Zimmermann on January 28, 2009 at 7:27 PM:

Cool site, Chris. Thanks for dropping by.


Billy Girlardo on February 09, 2009 at 1:43 PM:


3 years later and still rockin!

Thx so much!

Gee, am I an excited standardista or what? :-)


Serena on February 10, 2009 at 9:25 PM:

What's the right code for IE?

It's not work with IE7 :(


jurkis on March 20, 2009 at 3:07 AM:
The AntiVirus on April 06, 2009 at 1:19 AM:

I'm embedding a lot of videos from YouTube into my website and since I'm very concerned about the W3 validity I check every subpage against the compliance with the specs.

The errors generated by YouTube videos was a real pain in the neck. Now, after the mods, all my pages with videos embedded work like a charm!

Thanks for posting this tip, I'll be looking around your website for more useful articles.


John Dale on April 06, 2009 at 1:22 AM:

I'm trying to get rid of the validation errors at http://www.sytru.com/norton-antivirus but the YouTube videos still generate errors, even after having modified them according to your suggestions.

Is there a way I can workaround this?

Thanks in advance for any hints.


Joe on April 06, 2009 at 2:36 PM:

Nice, extremely handy!


Nickie on May 04, 2009 at 11:23 PM:

Thank you so much for providing an alternative code for the YouTube. I couldn't find one anywhere, and YouTube and other embed src were not validating.

Do you by any chance know how to use CSS for video's style, for example height and width? Please let me know, if you know how to.

Thanks again.


Random on May 20, 2009 at 6:44 PM:

It would be nice to have a PHP script that changed a Youtube! embed code into valid XHTML.


Nino Natividad on May 28, 2009 at 8:29 PM:

Thanks for the tips! :)


PHIL THORNTON on June 02, 2009 at 8:42 AM:

wow a 3 yr old thread!!

Thanks for this post - helped alot, 3 years on... who would have thought! lol


Salman on June 11, 2009 at 2:03 AM:

You can now use the freely available swfobject library to embed youtube videos in your web applications. The following examples show you how to embed youtube videos in this way and bonus tricks:




zbibo on June 29, 2009 at 3:23 AM:

this script is very helpful
but is there a way to embed a video without specifying the ID, in a way that everyday to embed the most recent one???
in our website, we need to embed everyday the recent Video from our channel.
so i'am asking if there is a way without each time to enter and change the code manually...

thanks a lot
any suggestion please...


Salman on June 30, 2009 at 9:37 PM:

@zbibo, your post looks oddly familiar. Did you look at YouTube custom players:


A custom player plays videos from specified YouTube account or playlist. Probably the most recent one is played first which i think is close enough for your needs.


Johnny on August 03, 2009 at 3:32 PM:

Unfortunately, this doesn't work at the Last.fm, precisely at the "About Me" box in a user's profile at the Last.fm.
Both the code given at the top of this page and the code produced by Nick Pettit's "validifier" are not functional at the Last.fm. :(
However, a clip from the Youtube can be posted to the Last.fm using this form: [youtube]http://www.youtube.com/watch?v=BHM5jsuoL[/youtube]

I'd appreciate it a lot if someone would provide a code or a form to post a Youtube clip of small dimensions (320 x 265) to the Last.fm, i.e. to the "About Me" box.

Thanks in advance!


Venkat on August 14, 2009 at 12:32 AM:

how to check if a video is embeddable on a web page or not?


goldfish on September 24, 2009 at 5:02 AM:

Thanks I have been looking all over for this!


Don_Pedro on September 28, 2009 at 1:26 PM:

Thanks! My same validator problem settled this way, too.
And various high value key infos collected from the comments, too.

Now 1000 generated pages of proprietery CMS (PERL generated) are zero error for "XHTML strict" - like ibm.com :-)

The most astonishing is:
This is now since 3 years here, and is to find via Google in a direct fast manner.
Of course, many complaints about the problem will have been addressed to youtub.com , in the meantime.
Why did the programmers there, with a multi-million annual budget, never settle this problem?
It is THEIR job, not ours, because THEY are paid for it, not we.

On the other hand, the importance of validation is low... The use of CAPITALS now is error, while it was standard 10 years ago...

When 10 years ago HTML tags / attributes were mainly programming language, they had to by upper case - should have been lower case, THEN.
Now that they mainly have a character of constants (due to crazy CSS conventions), they should NOW be in capitals - but now they have to be in lower case....

"Crazy conventions"? - It is a basic fault to let the user redefine the effect of elements of a supplied language. It is one of the worst possible violation of basic rules of systems using formalized languages...

HTML. XML , CSS, Javascript standards are bureaucratic horror stories, compared with the abstract logical perfection of PERL for scripting, Postscript /Adobe .pdf for style.

And validators tend to multiply one single true standard difference to 10 ... 100 ... or more "errors" or warnings...
Check the major German newspaper Frankfurter Allgemeine,
its site is: faz.net
Is it the Guiness Record Holder of the validation error count?
Over 5 000 errors and 300 warnings....

So faz.net is a good excuse for Web designers
when criticized by customers for the typical average of several 100 error messages of relatively long and complex web pages....


Emile on October 29, 2009 at 6:53 PM:

I would like to know if it's possible to use this embed code in combination with an insert of the video idea, this 11 digit code stacked in a mysql dbase. Is it possible and What would it look like?


malofey on November 13, 2009 at 12:45 AM:

Hey... Im so glad I found your site as I have been having problems with the different plugins Ive used to display youtube videos. Yours is the best method by far. Thanks!


Matthew on November 16, 2009 at 7:35 AM:

Thats very awesome. Thank you so much for providing an alternative code for the YouTube.


Lover of Sadness on November 20, 2009 at 8:13 AM:

thank u very much for ur post...
but could anyone help me embed the link of houndbite.com
they always break my html validation....


macaulus on December 02, 2009 at 9:46 PM:

happy to find this, saved me a lot of time searching aroudn the place


Joseph O'Kelly on December 20, 2009 at 1:41 PM:

This code still works.
Many of my embedded videos in IE had become blank boxes!
I have just prepared a new page useing your code It seems to work in IE FF Chrome and Safari.


Kelly on February 10, 2010 at 7:28 PM:

This code worked made it so that everything on my page works correctly, except my Facebook application no longer appears in Explorer.



Roger on February 22, 2010 at 1:50 AM:

You have no idea how happy I am to find this page. The Youtube tag in my bbcode parser was the only one left not producing valid XHTML 1.1 and now that's been solved, and in a way that works for IE users too :)


Melroy van den Berg on February 23, 2010 at 11:41 AM:

Thx :D Send YT an e-mail -,-


Jyri on February 25, 2010 at 8:52 AM:

This is awesome! At work we need to use xhtml-strict that validates properly and flash was a pain in the ***. Now however, I successfully added a flash file to one of our sites :)


links of london on March 12, 2010 at 7:15 PM:

wonderful. thnx for ur nice work.


Sam Johnson on March 22, 2010 at 2:38 AM:

So very much help. I was killing myself trying to get this valid. Thanks for the code!


Alex on April 02, 2010 at 4:29 PM:

To enable the fullscreen button with this XHTML compliant method:

The ALONE is not sufficient - it won't show you the fullscreen button.

You must add ?fs=1 to the Video's URL to make the fullscreen button work.

The available parameters are documented here:



Tony on April 21, 2010 at 1:25 AM:

Nice web.I have bought a pair of nike blazer shoes from a worldwide Zoom kobe v shopping website. Happy to share it with you sincerly.


ultradude25 on April 25, 2010 at 6:38 PM:

Doesn't work in Google Chrome. It loads the whole movie (Even if you don't click on the play button) before loading the rest of the page, instead of streaming.


Flv Player on April 27, 2010 at 11:49 PM:

Thank you for the quick tutorial.


hosting on May 02, 2010 at 8:07 PM:

It validates! And it's much lighter code. Thanks mate!


L Jones on June 11, 2010 at 4:35 PM:

Thank you! Worked great and the comments helped out, too.


ahdkaw on July 24, 2010 at 9:59 AM:

Wonderful, thanks for the code, worked a treat on my site, now my blog software finally validates the same as the rest of my site.

@Don_Pedro Whilst I agree with your sentiment, the great thing about HTML and XHTML is that you can choose either or a mix of the two, following strict rules or transitional rules, so it's up to the designer to choose the one they are most proficient in at the time. And as for the uppercase, lowercase changes, there is plenty of software that can do that for you across thousands of HTML documents in seconds, so it's not really a problem.


קייטרינג חלבי on August 22, 2010 at 4:44 AM:

I've have embedded a few videos in my website and have found them to be useful when trying to explain wesite concepts to customers.


Coolweb on August 26, 2010 at 4:19 AM:

Great, this code is valid @ validator.w3.org :)


Peter Rudd on September 05, 2010 at 10:29 AM:

Seems to work OK for me !



Carl Crawford on October 03, 2010 at 3:31 PM:

Thank you so much for this post. It saved my ass.


פסיכומטרי on November 19, 2010 at 6:08 AM:

I'd rather embed them using the xml wordpress plugin, but you are more technically advanced...


kit 4 cat on November 25, 2010 at 2:42 PM:

the xml template is not stable enough for these requirements.


eyal eldar on December 23, 2010 at 12:09 AM:

I don't understand what is xml templates


Hasan Seeder on February 11, 2011 at 3:06 AM:

Thank you very much


Kevin on February 27, 2011 at 4:07 PM:

You really save me. I have tried it out and it is now working. Thanks so much for your help.


Rita Barberá on March 17, 2011 at 2:14 AM:

very useful tip for my videos


Helle Frederiksen on June 06, 2011 at 4:25 AM:

Thanks - very usefull!


Marcel on October 08, 2011 at 3:24 AM:

Last time I embedded a player on my website. I made a small one and the quality of the audio was awefull. I changed the size to big and the audio was normal again. How is this possible?


Diane on October 08, 2011 at 3:27 AM:

@ Marcel. Yes, I don't know what that is with youtube, it really makes audio sound crappy.


euluism on October 13, 2011 at 12:18 PM:

You save my life!

Thanks for sharing this code

Is work for me!

Sorry my bad english!


Jamie on October 20, 2011 at 7:40 PM:

Is there a way to modify the new YouTube code to eliminate or shrink the css and js files? Combined they are a whopping 350K!


Sago David on October 21, 2011 at 2:24 AM:

Thanks for sharing...


Roofers El Monte on November 07, 2011 at 9:53 PM:

Brilliant job! The comprehensive data given was very helpful. I am hoping that you continue the excellent job done.


janaka on November 11, 2011 at 2:44 AM:

best site for sri lanka


Gabriel on August 22, 2012 at 8:55 PM:

Thank You! Your example helped me out when I was without a clue.
Thanks again...


Segue on June 11, 2014 at 9:40 AM:

Keeping old post going... thank you - found a good example and ran it through validator...

Segue to Solar


rajat gupta on August 13, 2014 at 11:35 PM:

thanks. i have been using you tube videos embeded in both wordpress n html websites. will check your guide to keep the validity intact.


atul choudhary on August 18, 2014 at 7:48 AM:

Thanks for sharing i keep in mind when i embed videos in sites


Random Thoughts on September 06, 2014 at 7:51 PM:

Youtube has finally made the embed code valid.


Bharti Gupta on July 05, 2015 at 10:58 PM:

will check in my html website. thanks.


jtewjmhi on July 18, 2015 at 4:54 PM:
Diseño Alicante on July 31, 2016 at 11:39 AM:

Thanks - very usefull!


Diseño Alicante on July 31, 2016 at 11:40 AM:

Thanks - very usefull!


fake tattoos on August 15, 2016 at 9:11 AM:

Thanks for sharing
This piece of code was very helpful


maillot on August 17, 2016 at 7:28 AM:

will check in my html website. thanks. helpful


celebrity fashion guide on September 26, 2016 at 11:28 PM:

Staying granted additional rights along with co-determination throughout society along with public lifestyle, women understood around 1920 the call to reflect his or her newly used role inside clothes these folks were wearing. Pre-loaded with a expanding self-esteem plus the desire to spice up in variations that indication their distinctive personalities, brand-new fashion variations were essential.


Murali M on October 17, 2016 at 5:53 AM:

thanks for the code , however -

It works great in chrome and Firefox but doesn't in IE 11...pls help me ASAP...


wallens on November 25, 2016 at 11:30 PM:

This is an incredible moving article.I am essentially satisfied with your great work.You put truly extremely accommodating data... www.embossitworld.com click to read more


} on November 23, 2018 at 5:24 PM:

http://aq3iy0on9qe86pqhoyzjfzsdkapbntrsiispkperu0m1lnfu64.net aq3iy0on9qe86pqhoyzjfzsdkapbntrsiispkperu0m1lnfu64



Pau segui on May 17, 2019 at 1:32 AM:

Thank you very much for the code. Greetings


Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.


Email Address:



Check this box if you hate spam.