February 10th, 2008

How-to embed YouTube or Google videos easily into any WordPress blog

I was surprised when I started this new blog that its near impossible to embed Youtube videos into WordPress. The reason for this is that WordPress does not allow random code to be inserted into a post. This means no OBJECT or EMBED period.

Blogs hosted on the WordPress.com site automatically have a handy shorttag to embed them:

[youtube:http://www.youtube.com/watch?v=VIDEO_ID_PASTED_HERE]


If you host your own WordPress blog like me, we have to use a plugin

Luckily it takes about 3 minutes to get the same functionality. We’re going to use the plugin “EasyTube”, created by Paul Bain. Here are the simple steps:

1. Download EasyTube.zip from the WordPress Plugin Directory. Unzip the files.

2. Copy easytube.php into your wordpress plugins folder, normally located in /wp-content/plugins/

3. Login to WordPress Admin and activate the plugin.

Once installed you can now use the following code anywhere

[youtube:http://www.youtube.com/watch?v=VIDEO_ID_HERE]

Add 2 values for size if desired. First value is height, second is width

[youtube:http://www.youtube.com/watch?v=Jb1_h9bguvI 300 200]

Want to embed Google Videos? Use the same syntax with a simple change:

[googlevideo:http://video.google.com/videoplay?docid=VIDEO_ID_HERE]

Leave a Reply