Embedding an iframe in Wordpress does not work
Asked Answered
M

3

6

I need to embed the following code on a self hosted Wordpress installation -

<iframe id="slydy" 
    style = "border: none; max-width: 100%; min-width: 100px;" 
    src = "http://slydy.co/users/TCC/01" 
    width = "648" 
    height = "435" 
    frameborder = "0" 
    marginwidth = "0" 
    marginheight = "0" 
    scrolling = "no" 
    allowfullscreen = "allowfullscreen"> 
</iframe>

but it just doesn't show up. I've installed the same on at least two other Wordpress blogs and it worked just fine.

What setting do i need to tweak?

Manful answered 20/6, 2015 at 8:20 Comment(0)
A
7

probably one of these things:

  1. if your website httpS then its blocked because your iframe is http.
  2. make sure that you in text ( not visual ) editing mode on post editing screen
  3. WP caching ?
Amp answered 20/6, 2015 at 8:38 Comment(2)
Or, Same Origin Policy - developer.mozilla.org/en-US/docs/Web/Security/…Kenning
OK, It's not Same Origin Policy in this case as I've just tried it and it works.Kenning
A
2

The Wordpress editor blocks/removes iframes. Try using some of the plugins out there that supports iframes, og make an Shortcode to make iframes.

Abbottson answered 20/6, 2015 at 9:8 Comment(2)
This may no longer be correct, and/or depends on where in WordPress you're putting your iFrame code. For example, in WordPress 5's Editor/Custom HTML block, an iframe renders just fine.Sharasharai
Unfortunately, Wordpress still blocks/removes iframes on sites hosted by Wordpress.com: > For security reasons, the following tags are only allowed on plugin-enabled sites: > embed, frame, iframe, form, input, object, textarea, style, linkExcrement
B
0

I don't know why, but embeds were working fine on my website. Suddenly, I noticed that the embeds only show in the WordPress customization mode (on the visual part). When I save the changes and close the customizer, the iframe embeds don't show up. After searching on Google, I found a solution. The solution is the Iframe Plugin, which can be found here: https://wordpress.org/plugins/iframe/

After enabling this plugin on your website, you just need to change the codes like this:

For example, if your iframe code is <iframe ...........................> '</iframe ' >', you have to change it to [iframe ...........................].

So what you are doing here is changing < with [ and removing the '</iframe'>'.

Hope this helps someone.

Balder answered 14/3 at 10:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.