How to embed YouTube videos to a Wordpress blog

by Vivien

When I tried embedding Adobe Photoshop CS3 video from YouTube in my previous posts it didn’t work. It messed up my blog, and nothing was appearing after that post. So I started searching on Google on how to ow to embed YouTube videos to a Wordpress blog. I found several tutorials and tips, still had troubles with some of them, but after a few attempts I got it right.

As it turned out, you cannot just paste the embed code to the editor window when TinyMCE WYSIWYG editor is on, nor can you paste the embed code to the HTML source by clicking on HTML icon, you need to turn off the WYSIWYG. So to spare you the same frustration I had and if you’re struggling to get your YouTube video embedded to your blog, here’s what you need to do:

  1. Login to WordPress admin
  2. Go to Options >> Writing *
  3. Uncheck box “Users should use the visual rich editor by default” *
  4. Go to Write >> Write Post
  5. Paste the YouTube code in the write box
  6. Publish

* if you logged in as admin you might need to turn off rich text editing under Users >> Your profile.

Also, keep in mind that the <embed> tag is deprecated in XHTML 1.0, so instead of embedding YouTube’s code as it is suggested on their site (their instructions are given on the left side from the actual video), use the following format:

<object type=”application/x-shockwave-flash” width=”425″ height=”350″ data=”http://www.youtube.com/url”><param name=”movie” value=”http://www.youtube.com/url” /></object>

Make sure to replace the video URL with the one you’re using in your blog.

There’s also a quick way of adding YouTube or other videos to your blog - using Video Quicktags plugin.

This entry was posted on Wednesday, December 27th, 2006 at 9:09 pm and is filed under how-to, wordpress. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Digg this story ?

14 Responses to “How to embed YouTube videos to a Wordpress blog”

  1. Steve Says:

    thank you, I have added this to my delicious, will use as a reference when I add youtube videos to my blog

  2. ibit Says:

    You’re welcome. And welcome to my blog, Steve :-)

  3. Mara Mei Says:

    Thank you. This is very usefull.

  4. Aby The Liberal Says:

    Thank you very much for this article. I had a hard time trying to insert YouTube videos on my WP website, now the plugin and tips were really useful.

  5. Vivien Says:

    You’re all very welcome. Glad this article is helping others with embedding YouTube videos.

  6. Chris Says:

    Hm somehow I have nothing like this option in Wordpress MU

  7. Sandra Says:

    Thank you for posting this ;).

  8. Vivien Says:

    Chris, did you try just pasting the code from YouTube?

    You’re welcome, Sandra.

  9. UrWar Says:

    Thanks for the great tips on embedding youtube videos in wp blogs.

  10. Vivien Says:

    You’re very welcome, UrWar. Have you upgraded to the latest version of Wordpress 2.5? It has a new way of embedding video and other media links.

  11. fox Says:

    Hi

    I’ve been having huge amounts of trouble with this all day, I’ve tried EVERYTHING and can’t get it to work. I did everything you said above but when I click ’save’ the code just disappears. I tried copying/pasting Youtube’s own embed code but the same thing happens. I can’t try plugins as I don’t have the wp/plugins folder needed to upload them (I have a blog on Baywords which uses Wordpress). Am I doing something wrong? I cannot figure out what’s going wrong.

  12. Vivien Says:

    @fox
    Did you copy&paste Youtube’s code after switching to HTML tab in the Write section, not the Visual? As long as you copy the code in HTML, everything should work. Good luck with it.

  13. fox Says:

    @Vivien

    Thanks for the reply. Yeah I did do that and it still didn’t work, hence why I’m so stuck

  1. Pixellore - Design. Gadgets. Life. » How To Add YouTube Videos to Wordpress Says:

    […] code into the WYSIWYG editor. You’ll have to turn off. After searching google I followed this process and voila it […]

Leave a Reply