Iframe in a post

As a test, I edited this post in the Visual editor, switched to HTML to add the iframe, and published. Never go back to the Visual editor after adding an iframe tag to a post because the TinyMCE editor will strip it out.

It’s advisable to install the tiny RawHTML plugin, if you use the Visual editor often. After you install it, you can use the short tag [raw](protected code here)[\raw] to preserve your code. I prefer to use the HTML editor routinely, and have the RawHTML plugin. However I did not enclose the <iframe> tag in this post with the plugin’s <!--raw_start--><!--raw_end-> special comment tags.

The alternative is to edit the TinyMCE config to add "iframe" to the allowed list of tags, but the config file will be overwritten when you update WordPress.

Share

Leave a Reply

  

  

  


*

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>