[iframe src=”http://www.youtube.com/embed/4qsGTXLnmKs” width=”100%” height=”500″] shortcode
should show something like this:

WordPress removes iframe html tags because of security reasons.
Iframe shortcode is the replacement of the iframe html tag and accepts the same params as iframe html tag does.
You may use iframe shortcode to embed content from YouTube, Vimeo, Google Maps or from any external page.

If you need to embed content from YouTube, Vimeo, SlideShare, SoundCloud, Twitter via direct link, you may use [embed]http://www.youtube.com/watch?v=4qsGTXLnmKs[/embed] shortcode.
[embed] shortcode is a core WordPress feature and can embed content from many resources via direct link.

Important: You can not embed HTTP pages into HTTPS pages and vice versa.
So the protocol (http or httpS) for parent and embedded page should match.

iframe params:

  • src – source of the iframe: [iframe src="http://www.youtube.com/embed/4qsGTXLnmKs"]; by default src=”http://www.youtube.com/embed/4qsGTXLnmKs”;
  • width – width in pixels or in percents: [iframe width="100%"] or [iframe width="600"]; by default width=”100%”;
  • height – height in pixels: [iframe height="500"]; by default height=”500″;
  • scrolling – with or without the scrollbar: [iframe scrolling="no"]; by default scrolling=”yes”;
  • frameborder – with or without the frame border: [iframe frameborder="0"]; by default frameborder=”0″;
  • marginheight – height of the margin: [iframe marginheight="0"]; removed by default;
  • marginwidth – width of the margin: [iframe marginwidth="0"]; removed by default;
  • allowtransparency – allows to set transparency of the iframe: [iframe allowtransparency="true"]; removed by default;
  • id – allows to add the id of the iframe: [iframe id="custom_id"]; removed by default;
  • class – allows to add the class of the iframe: [iframe class="custom_class"]; by default class=”iframe-class”;
  • style – allows to add the css styles of the iframe: [iframe style="margin-left:-30px;"]; removed by default;
  • same_height_as – allows to set the height of iframe same as target element: [iframe same_height_as="div.sidebar"], [iframe same_height_as="div#content"], [iframe same_height_as="body"], [iframe same_height_as="html"]; removed by default;
  • any_other_param – allows to add new parameter of the iframe [iframe any_other_param="any_value"];
  • any_other_empty_param – allows to add new empty parameter of the iframe (like „allowfullscreen” on youtube) [iframe any_other_empty_param=""];

Capturi ecran

  • [iframe] shortcode


  1. install and activate the plugin on the Plugins page
  2. add shortcode [iframe src="http://www.youtube.com/embed/4qsGTXLnmKs" width="100%" height="500"] to page or post content


25 iunie 2019
After a php update my old jalbum plugin stopped working. iframe saved the day.
27 ianuarie 2019
After updating wordpress, everything looked fine. Until some small edits were made on a page with an embedded map. The editor then kept swallowing the link, deleting it entirely. No notice that the content wasn't going to be saved or published, and no signs that something was wrong. I spent a few hours trying to get it to go back to how it was, even used a plugin to revert to the old editor, but to no avail. I found this, and it works perfectly! THANK YOU! and to the wp dev team, the new editor should go back to the hole it crawled out of and never be forced on anyone ever again.
1 iulie 2018
This plugin saved me! It's the only functioning.
16 februarie 2018
I activated plugin and pasted sample code exactly. Nothing displays. Ended up using EMBED tags instead and the same YouTube video displayed fine.
18 mai 2017
Hi I've installed the plugin and activated it. This is my iframe now embedded in the code of my page which is not working. [iframe src="mylink.com" width="100%" height="800"] This is the link where it has to display - WordPress literally strips out the html: https://www.pmgza.com/car-insurance-quote-2/ I'm really hoping I missed something. Thanks Mel
Citește toate cele 48 de recenzii

Contributori și dezvoltatori

„iframe” este un software open-source. La acest modul au contribuit următoarele persoane.


Tradu „iframe” în limba ta.

Te interesează dezvoltarea?

Răsfoiește codul, vezi depozitarul SVN, sau abonează-te la jurnalul de dezvoltare prin RSS.

Istoric modificări


  • minor cleanup.


  • minor refactoring.


  • minor bugfixing.


  • removed onpageshow and onclick params. Reason: XSS vulnerability (thanks to dxw.com).


  • removed get_params_from_url param. Reason: XSS vulnerability (thanks to dxw.com).
    If you still need this feature you can [download iframe ver 3.0[(https://wordpress.org/plugins/iframe/developers/) and stick to it but keep in mind of XSS vulnerability.
  • removed onload param. Reason: XSS vulnerability (thanks to dxw.com).
  • escaping attributes


  • removed same_height_as=”content”, same_height_as=”window”, same_height_as=”document” features because it was not working properly
  • rewrote the javascript-code using pure JavaScript and without jQuery – no need to load jQuery for every site using iframe plugin
  • removed function_exists check because each function has unique prefix
  • code refactored
  • update docs
  • set height=”500″ instead of 480 by default
  • set scrolling=”yes” instead of „no” by default


  • remove ‘&’ from the end of the string in ‘get_params_from_url’ param


  • remove fix for google maps


  • minor changes


  • minor changes


  • added ‘get_params_from_url’ (thanks to Nathanael Majoros)


  • minor changes


  • small fixes
  • added (src=”http://www.youtube.com/embed/4qsGTXLnmKs”) by default


  • fixed bug (Notice: Undefined index: same_height_as)


  • added (frameborder=”0″) by default


  • plugin core rebuild (thanks to Gregg Tavares)
  • remove not setted params except the defaults
  • added support for all params, which user will set
  • added support for empty params (like „allowfullscreen” on youtube)


  • Added style parameter


  • Fixing minor bugs


  • Added auto-height feature (thanks to Willem Veelenturf)


  • Using native jQuery from include directory
  • Improved „same_height_as” parameter


  • Added „same_height_as” parameter


  • Added „id” and „class” parameters


  • Added „output=embed” fix to Google Map


  • Parameter allowtransparency added (thanks to Kent)


  • Versiunea inițială