How to embed YouTube or Google Videos in WordPress

It’s not always a simple case of pasting the YouTube or Google “embed code” into your blogs default editor. Sometimes you need to turn off the WYSIWYG bit which is messing up your embed code… don’t worry, it ain’t hard. You only need to do this if you’re hosting your own WordPress blog – if you’re on wordpress.com you can use the [youtube=…] and [googlevideo=…] tags!

In Options -> Writing section of WordPress admin (wordpress-location/wp-admin/options-writing.php)

  • Ensure “Users should use the visual rich editor by default” and “WordPress should correct invalidly nested XHTML automatically” are turned off.

In Users -> Your Profile, down the bottom (wordpress-location/wp-admin/profile.php):

  • Ensure “Use the visual rich editor when writing” is turned off

You can now paste the code in with WordPress mashing it up on you.

Pretty simple, eh? Don’t forget to reverse the setting afterwards, if you’re more of a WYSIWYG blogger.