• This is driving me crazy. I am on a self-hosted site (on Rackspace) and just starting today I haven’t been able to add an iFrame to a post OR page. When I am in the HTML editor and click publish or save as draft, when it saves and refreshes the page, the iFrame code is gone! And it doesn’t show up on the published page either. All other code saves… just not iFrame. This has NOTHING to do with iFrame code disappearing when you switch back and forth from the WYSIWYG editor. I never even use that.

    I can’t figure what changed. I did update a plugin this morning, but even deactivating that plugin doesn’t fix it. Why would code not save??

    And FYI I am the Admin on this site. And it happens for all users.

    Thanks!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • WordPress strips out iframe code as a security precaution, so your best bet is installing a plugin like [iframe], which lets you embed the video using a shortcode, like so:

    [iframe src=”https://player.vimeo.com/video/3261363″ width=”100%” height=”480″]

    The only problem with this particular plugin is it hasn’t been updated for compatibility with WordPress 3.4.1. I’ve tested it on a couple of sites running the latest version of WordPress, and it appears to be working fine, but there’s no guarantee all will be well. I’m currently researching alternative iframe plugins that have been updated for 3.4.1 but haven’t come across one yet. I’ll post an update here if I find a better option.

    —Melissa ??

    It would probably be better if you just created your own custom page template and put the iframe within it.

    https://codex.www.ads-software.com/Pages#Creating_Your_Own_Page_Templates

    Thread Starter russface

    (@russface)

    Neither answer is correct or answers my question. To the first poster, I said that I am the administrator. WordPress DOES NOT strip out iFrame for admins, just users with lower levels. And it was working before… until Friday.

    And to MickeyRoush, I just need to add YouTube and Soundcloud embeds to my posts. And I know you can just put a Youtube URL in there and it’ll automatically embed it, but not with the same customization. Your suggestion would be if it were part of the framework of my site.

    So if anyone else has an answer, that would help!

    Sorry that my solution doesn’t work for you. It’s what I use for my sites. I just create custom templates in my child theme and give them read only permissions. That’s the safest way to go.

    But if you’re really wanted to make sure your customization sticks through edits via the dashboard then you might want to try using a plugin like this one:

    https://www.ads-software.com/extend/plugins/raw-html/

    Be weary of the way iframes work and their security implications. Make sure you use escape entities and iframe flags whenever you can/need to. There’s a reason why WordPress strips and/or converts HTML to their corresponding escape entities. If you know how to incorporate Mozilla Content Security Policy, you might want to do that as well to protect your users from any malicious iframe injections.

    You may want to look through the iframe plugins. There’s quite a few of them and maybe one will support your customizations.
    https://www.ads-software.com/extend/plugins/search.php?q=iframe

    Install “Capability Manager” and enable unfiltered_html for editors. If you’re running multisite, you’ll also need Unfiltered MU.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘iFrame Disappearing’ is closed to new replies.