I have a blog that I often need to insert iframes into posts for various reasons (don’t ask why just trust me!)

When I use the “visual” view to edit my posts the WYSIWYG constatantly strips out my iframes …

I know I can keep the iframes in the post if I use the “html” view and only view/save from the “html” view … however I’d really like to be able to use the normal WYSIWYG to edit my post without having to resort to the “html” view.

Is there anything I can do to disable this behavior? I’ve seen this post, that suggests editing wp-includes/js/tinymce/tiny_mce_config.php, but I’d really rather avoid doing something like that that would likely just break in a upgrade!

6

If you don’t want to write your own code there is a plugin to allow embedding an <iframe>:

  • Embed IFrame Plugin for WordPress

Then just use the shortcode like this:

[iframe http://example.com 400 500]

Leave a Reply

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