So you have a WordPress site or any type of site for that matter and you’ve got it looking just about perfect, you’ve filled it with great content… everything is set except you notice those YouTube and Vimeo embeds keep throwing up XHTML validation errors. Well look no further, here are two easy ways to clean up that code and get your site XHTML valid.
First off the reason they’re not validating is because YouTube and Vimeo both use the <embed> tag which has been depricated in XHTML 1.0.
For each of these examples I will provide a link to a page where you can simply copy and paste in your YouTube or Vimeo embed code, set the size of your player and hit a button to get back XHTML 1.0 transitional valid code which you can then embed on your site. I will also provide an example of both the non valid code and the valid code so you can see the differences.
YouTube
Valid XHTML 1.0 YouTube embed tool
Original Non-Valid YouTube code
<object width="575" height="340"><param name="movie" value="http://www.youtube.com/v/w8faZ9LRors&hl=en&fs=1&hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/w8faZ9LRors&hl=en&fs=1&hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="575" height="340"></embed></object>
Valid YouTube code
<object type="application/x-shockwave-flash" style="width:575px; height:340px;" data="http://www.youtube.com/v/w8faZ9LRors"> <param name="movie" value="http://www.youtube.com/v/w8faZ9LRors" /> </object>
Here’s the valid YouTube video in action…
Vimeo
Valid XHTML 1.0 Vimeo embed tool
Original Non-Valid Vimeo code
<object width="575" height="431"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6639576&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6639576&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="575" height="431"></embed></object>
Valid Vimeo code
<object type="application/x-shockwave-flash" style="width:575px; height:431px;" data="http://vimeo.com/moogaloop.swf?clip_id=6639576&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=ff9933&fullscreen=1"> <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6639576&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=ff9933&fullscreen=1" /> </object>
Here’s the valid Vimeo video in action…



Well I am looking for my new wordpress theme and I found out this site. I am interested in video blog especially animes and tv series. With this, It will help me alot how to embed videos. All I do since then is to copy and paste not knowing it if is a valid or not!