Wordpress: Solving The YouTube Problem
Friday, September 7th, 2007 at 3:00 pm
I was quite surprised when I recently tried to embed a YouTube video in a post on my Wordpress blog and it did not work properly. Upon researching the matter I found that it is a known issue. Wordpress does not like strange things embedded in posts and unfortunately, YouTube is one of those things!
A number of video-related plugins are listed on the Wordpress Plugin database. Many of these plugins have multiple features, but I was just looking for the simplest solution to embed a YouTube video in my post…
I found Paul Bain’s “EasyTube” solved my problem quite effectively.
- Download the .zip file from the link above, extract the contents and copy the .php file to your Wordpress plugins folder (located in your blog’s root-folder > wp-content > plugins).
- Log into your WP-admin and activate EasyTube from the Plugins control panel.
- To embed a video in your post, write “youtube:” followed by the URL of the video. Enclose this line in square brackets and you’re done. It should look something like this:[youtube:http://www.youtube.com/watch?v=XxXxxxxXxxX&eurl=]
- Remember to use the URL of the video, not the embed code!
You can write this code in either the visual or code editor of your Wordpress blog and the result is a valid page containing your video.
If you know of any other solutions to this problem, please post a comment!




















redwall_hp Says:
September 7th, 2007 at 3:34 pm
It’s the WYSIWYG editor that’s doing it. If you’re never going to edit a post again, than you technically can just paste it into the code tab, then publish. The problem is, if you ever open the post in WYSIWYG mode again (or just switch the tab after pasting the code), Wordpress will strip it out.
It gets worse in Wordpress MU, where WPMU totally blocks any code it doesn’t recognize for “security reasons”. That includes YouTube videos.
Plugins seem to be the best option for now. At least until Wordpress supports YouTube natively.
Blogsolid Says:
September 7th, 2007 at 3:57 pm
I just tested it, and you’re right, redwall, if you place the YouTube embed code in the code tab and publish immediately, it does work!
The problem, as you pointed out, is that if you go back and edit the post again, it seems to break…
redwall_hp Says:
September 7th, 2007 at 5:01 pm
Yeah, that’s always been one of the most annoying Wordpress “features” (read: bugs). Pretty much every other platform supports YouTube, and any other flash-based video site. It’s about time they fix it. Yes, plugins work okay, but you can’t see the video in the post editor while you write accompanying text. Wordpress needs a new editor. TinyMCE works okay, but it’s a big pain with stuff like videos (it also likes to “fix” code you wrote, replacing DIVs with Ps and things like that).
Memo Says:
September 7th, 2007 at 5:59 pm
That’s one of the reasons why I use a blog desktop client, as I find the WYSIWYG editor included in Wordpress annoying and basically useless. For example, I hate when it refuses to automatically break a line breaking the layout.
Blogsolid Says:
September 7th, 2007 at 6:48 pm
Hi Memo
Can you recommend a desktop client that works well with Wordpress?
Wes Says:
September 7th, 2007 at 7:04 pm
I actually recommend Viper’s Video Quicktags.
It puts in buttons for videos from several video sharing sites. Also, it doesn’t seem to break when you edit it, since it uses its own special tags.
As for a desktop client for Wordpress, I’ve used w.Bloggar with some success, tried out Ecto liked it, but it wasn’t free; and also tried out BlogJet and liked it but once again it wasn’t free.
In the end, I came to the conclusion that software isn’t really worth the time considering you can disable the WYSIWYG (or WYSIWTF) view.
Blogsolid Says:
September 7th, 2007 at 7:10 pm
Haha, thanks Wes, WYSIWTF is quite accurate!
redwall_hp Says:
September 7th, 2007 at 10:37 pm
I say we just go over to http://wordpress.org/extend/ideas/ and demand a new WYSIWYG editor. :D
Actually, there have been people doing just that. I believe it’s actually being considered, though who knows when we’ll get it.
BlogBuzz September 8, 2007 » Webmaster-Source Says:
September 8th, 2007 at 12:26 pm
[…] think yesterday was “Wordpress Irritation Day.” Blogsolid.com penned a post on making YouTube videos work in Wordpress. Later that day, BookAdvice.net’s Wordpress installation started acting up. It seems that […]
Blogsolid Says:
September 10th, 2007 at 9:34 am
I did not manage to download Viper’s Video Quicktags plugin from the link above, so here’s a link to the wordpress plugin page for Viper’s Video Quicktags.
Myo Kyaw Htun Says:
September 15th, 2007 at 5:52 am
Seriously, Wordpress Tiny MCE editor always change the object embed code every time i paste in editor. That makes my site invalid XHTML. Now what I did it, I embed flash code by using Adsense deluxe plugin. That’s pretty work for me.
Jeff Says:
September 17th, 2007 at 10:41 pm
Hey everybody-
My solution to the issue was first to dl Firefox, which I only use for blog posting, and then the above solution you have is correct. Whenever I post a video, I click ’save and continue editing’. You will be able to jump back into the code after that and continue editing. Hope this helps a little.
-jv
Googlelady Says:
September 22nd, 2007 at 12:01 pm
This video step-by-step on how to embeded yourtube videos in wordpress:
http://www.blognetize.com/26/e.....wordpress/
No need of a plugin.
rest Says:
February 9th, 2008 at 12:21 pm
an? what you think about teachertube?
www.portakal.in Says:
February 20th, 2008 at 2:13 pm
thanks
fudge.org » Blog Archive » Embedding YouTube video in WordPress Says:
February 26th, 2008 at 10:46 pm
[…] Result: Newlines are being added somehow by the editor (and the ampersand converted as well) and crushing out the object tag and impacting a div somewhere else which causes further page rendering to be centered. Ick. […]
youtube traffic Says:
July 14th, 2008 at 5:11 am
thank you for such a great topic. I have learned a lot by reading on this website today.
prashant Says:
July 15th, 2008 at 2:39 pm
Thanks a lot. Used this in my blog, I was facing the same problem.
Colleen Says:
July 18th, 2008 at 9:17 pm
I’m running WordPress MU for my blog, and my code was stripped too. Here’s how you can edit MU to keep the code from being stripped.
Open this file: wp-includes > ksep.php
Look for a line like this: if (!CUSTOM_TAGS) {
Add the following two (I put them in alphabetical order with the existing allowed tags)
‘embed’ => array (
’style’ => array (),
‘type’ => array (),
‘id’ => array (),
‘height’ => array (),
‘width’ => array (),
’src’ => array ()),
‘object’ => array (
‘height’ => array (),
‘width’ => array ()),
‘param’ => array (
‘name’ => array (),
‘value’ => array ()),
‘object’ => array(
‘width’ => array (),
‘height’ => array (),
‘movie’ => array (),
‘allowFullScreen’ => array (),
‘embed src’ => array(),
‘application/x-shockwave-flash’ => array()),