How To Allow Video Embeds In WordPress’s HTML Editor

My hosting company finally upgraded my WordPress version to 2.0.4 after I complained about the old version I was forced to use. This was important to me because I have done some work creating custom WordPress designs and I wanted to show off a fancy custom design on my blog. It also makes it easier to deal with all the spam comments this blog receives.

WordPress has an HTML editor called TinyMCE which does not allow you to embed videos. The embed tag is not allowed in the HTML but you can edit a file to change that. Find the file tiny_mce.js in the directory wordpress/wp-includes/js/tinymce/. Edit line 101 which reads:

this.defParam("extended_valid_elements", "");

Change it to read:

this.defParam("extended_valid_elements","embed[style|id|type|src]");

After you save that file you should be able to paste video embed code into the WordPress rich editor, TinyMCE. Please note that you should only use the embed tag and leave out the surrounding object tag.

http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/extended_valid_elements

This entry was posted in General. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit exceeded. Please complete the captcha once again.