Take the tour ×

I need to embed an iFrame into a post and it appears that tinyMCE or something is stripping it out when I go from HTML to Visual view while editing a post.

I've found instructions for adding valid elements to tinyMCE but it only seems to apply to WordPress 2.8. No such file seems to exist under WordPress 3.0.1 (see Make WordPress WYSIWYG not strip out iframe's)

None of the iFrame embedding plugins seem to support WP 3.0.1 either.

Thanks for any tips.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Did you try this solution: http://wordpress.stackexchange.com/questions/3041/make-wordpress-wysiwyg-not-strip-out-iframes/3067#3067?

share|improve this answer
That seems to have done the trick - must have missed this part - thanks! Just had to paste the following before the function to make it show up as a plugin: <?php /* Plugin Name: Change tinyMCE Options */ –  cpuguru Oct 29 '10 at 21:01
add comment

Copy paste this code in your functions.php :

add_filter('tiny_mce_before_init', create_function( '$a',
'$a["extended_valid_elements"] ="iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]"; return $a;') );

This will add a filter to tinymce editor. Working on WP 3.xx

share|improve this answer
add comment

I use tinymce advanced plugin which has the option to not strip iframes in the settings panel.

share|improve this answer
add comment

Your Answer


