I’ve had problems with embedding Youtube videos in Wordpress blog posts in the past, and since I don’t post videos often enough to remember the solution I end up researching my problem each time. Now that I’ve got the solution down I figured I’d share it with you in case you run into the same trouble. I haven’t upgraded to Wordpress 2.5, so I’m not sure if the fix is already be built in the newest version. If it is fixed in newer version then this only applies to older versions of Wordpress.
There are two solutions to the problem:
1. Turn off the Visual Editor in your user options
2. Keep Visual editor on but switch to Code mode when posting YouTube embed code
Turning off the Visual Editor
What seems to be messing up embeded YouTubed videos is Wordpress’ Video Editor. The simple solution is to just turn the visual editor off. To do this simply go to Users -> Your Profile, then uncheck the box that say “Use the visual editor when writing”. This may be a hassle if you want to use the visual editor to edit the post or even edit other posts, because you would have to keep turning the visual editor of and on. The other solutions is to…
Keep Visual editor On But Switch to Code Mode When Pasting YouTube Embed Code
To do this just write your post as you usually would, but wait until you are just about ready to publish your post to insert the Youtube video. When you have done everything except insert your Youtube video, just switch to Code mode (click on the tab next to “Visual” just below the Title box), and paste your Youtube embed code while in Code editing mode. Then click the publish button without going back to Visual mode. It is important that you do this very last, because if you go back to Visual mode your Youtube embed code will get messed up by the Wordpress Visual Editor.
So, basically just avoid using the Visual Editor if you don’t want your embeded Youtube videos to get messed up. If you need to ever go back and edit a post with an embeded YouTube video make sure to re-paste the emded code while in Code mode if you use the Visual Editor to edit the post.
I plan to upgrade to Wordpress 2.5 in the coming weeks so if there is simpler solution or if the problem has been fixed in that version I will let you know. Please comment with your own experience if you have already used Wordpress 2.5 to post Youtube videos.





