Support » Fixing WordPress » Can I put an iframe on a WP page?

  • Hi, I have an iframe that I am trying to add to a new page, using the html section in the page editor. When I switch to visual view or preview, the code disappears. Is it not possible?

    Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • I believe WordPress sanitizes your input and automatically kills <iframe>, among other things.

    You could use a custom page template for the page you’re creating and then code the iframe into the template. Or hard-code it into page.php and use an is_page() conditional to have it show up only on the new page you created.

    Will work in visual view as well. But yes you might find the code dissapears when you switch back again to html view. I have done iFrames many times on different sites. Just don’t play too much. Trick is save a copy of your code in a text editor (just in case) while you are making new changes and do not switch back and for to visual view.
    You only need something basic for iFrames like:

    <iframe src =”” width=”100%” height=”300″>
    <p>Your browser sucks. It won’t work with iframes.</p>


    You can embed it with the help of plugins..please check this…


    Shane G.

    When I switch to visual view or preview, the code disappears.

    Place your iframe wherever you need it in the page. No plugin required. Do not switch between the html and visual editor while doing so. Place your iframe via html, and publish the page. Check the result and adjust if required.

    I stand corrected, then. Spent too much time lately learning about WP filtering, now I think everything’s filtered. 😉

    You can do it so that when you switch from html to visual the iframe is still there, I have done this with the assistance of the plugin Max Banner Ads Pro on my website, you create a zone in widgets, then in options for that zone you tick single post/page. Then you add banner and the iframe text is copied into the Other Text Ads/Flash/Javascript (Adsense, Adbrite etc…) box and saved, then under the actions for that banner copy the post tag into your html editor wherever you want it on the page and will look something like this <!–MBA:Banner=7–> in the html when you switch to visual you see nothing but when you swith back, bingo it is still there. this saves yo from having to re copy the Iframe into to your page everytime you edit that page. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can I put an iframe on a WP page?’ is closed to new replies.