Embedding a YouTube video in your blog post

You’ve probably all seen this on magazine sites and Facebook posts: a video directly included within the body of the page, rather than a link. Embedding like this helps readers follow up on the video without disrupting their reading of your post or taking them on a distracting journey away from the site. If you’ve wondered how people do this, wonder no more:

  1. On any YouTube or Vimeo page you want to embed, click the Share button; a link should appear, and next to that a button labeled Embed.
  2. Click Embed and some html code will appear. Copy that to the clipboard.
  3. Now comes the one tricky step: come back to where you’re editing your blog post, scroll down to wherever you want the video to appear, and paste in that YouTube code you copied. Then convert the html code you get from YouTube or Vimeo into wordpress “shortcode,” mostly by converting angle brackets to square brackets. It will start out looking something like this:

    <iframe height=”315″ width=”420″ src=”http://www.youtube.com/embed/ppS0tzr2Eyk” frameborder=”0″></iframe>

    But we want it to look like this:

    [iframe width=”420″ height=”315″ src=”http://www.youtube.com/embed/ppS0tzr2Eyk” frameborder=”0″ ]

    Note that the final close-tag (angle brackets and a slash) is also removed.

  4. Publish (or Update) the blog post, and enjoy your spiffy video!
This entry was posted in ITF Corner and tagged . Bookmark the permalink.

Leave a Reply