How to Allow Iframe on TinyMCE WYSIWYG editor

TinyMCE is a good wysiwyg text editor which you can on your site by free. It is also used as additional module on some CMS like drupal. However (bacause of security problem) this wysiwyg editor lack of iframe button. You also can’t insert iframe code, even you insert in html area. TinyMCE will remove any iframe code on your editor. Don’t worry, by default TinyMCE doesn’t allow iframe but it still support iframe. You just need add some code on your site.

Using Custom Website
Go to file where you add tinyMCE.init Usually it’s located on the file that contain text editor. I am sure you know about this. Except you’re new webmaster 🙂

Add the following code on tinyMCE.init

extended_valid_elements : “iframe[src|width|height|name|align|frameborder]”,

Restart you website and try to insert iframe code like youtube, etc and see the result

Using Drupal
The easiest way to enable iframe on TinyMCE wysiwyg drupal is by install WYSIWYG IFrames module.

  • Go to Modules > Install New Modules then install WYSIWYG IFrames module online or by uploading file if you have downloaded before. Please choose .ta.giz format
  • Active the modules
  • Don’t forget go to Configuration > Content Authoring > WYSIWYG Profile > Edit profile > Buttons and Plugins > Check Iframe Fix
  • Try to insert iframe when using wyiswyg editor on edit or add new content.

Now you should be able to post iframe using TinyMCE wysiwyg editor. Please note that iframes can be a security blackhole, so only expose this option to user’s that need it.

5 thoughts on “How to Allow Iframe on TinyMCE WYSIWYG editor

  1. I like your website and I thought I would share the company I use to get lots of website visitors. I am very happy with the traffic that I get from their company and I would recommend them to any website owner.

  2. We are a bunch of volunteers and opening a brand new scheme in our community.

    Your web site provided us with useful info to work on. You’ve done a
    formidable process and our whole community shall be grateful to you.

  3. You share interesting things here. I think that your blog can go viral easily,
    but you must give it initial boost and i know how to do it,
    just search in google for – wcnu traffic increase

Leave a Reply

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