ClockInfo.com
Commentary about clock repair and clock history from Bill’s Clockworks and ClockHistory.com

ClockInfo.com

Embedding a YouTube Video in WordPress

By on December 22, 2007

Here is how to embed a YouTube video in your WordPress blog or website. Copy the embed code for the video from the YouTube page. Switch to the “Code” mode of the WordPress editor and paste in the You Tube code. Then (and this is the trick that was so elusive) put an HTML <pre> tag before the YouTube code and put a </pre> after the YouTube code. The <pre> and </pre> tags keep WordPress from messing up the code. (Note: this may also work for embedding Flickr slideshows, but I have not tried it yet.)

Here is a sample video, I love this song and it is appropriate to the season (Mary Did You Know, performed by Mark Lowry):

Thanks to this post for the idea of using the <pre> and </pre> tags.

Previously suggested solutions to posting YouTube videos include:

  • Turning off the visual editor when editing a post containing a video. This works, but is cumbersome. It is described several places, including this post.
  • Using a code of the following type: [youtube=http://www.youtube.com/watch?v=P0WIJw8JVeU]. This did not work for me. It is described in this post.

Related posts:

  1. Setting up WordPress
  2. WordPress Permalink Format
  3. Creating a Web Site for My Church
  4. Removing the Self Links on the Home Page

Leave a Reply

Name

e-Mail (will not be published)

Website