# Embed an iframe on a Discourse hosted site

**URL:** https://meta.discourse.org/t/embed-an-iframe-on-a-discourse-hosted-site/56676
**Category:** Feature
**Created:** [January 31, 2017, 11:07pm UTC](https://meta.discourse.org/t/embed-an-iframe-on-a-discourse-hosted-site/56676 "2017-01-31T23:07:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [January 31, 2017, 11:07pm UTC](https://meta.discourse.org/t/embed-an-iframe-on-a-discourse-hosted-site/56676/1 "2017-01-31T23:07:59Z")

</div>

I have a client who would like to be able to embed an iframe on a Discourse hosted site. As far as I can tell, it isn’t currently possible to whitelist an iframe through a site customization - the post is cooked on the server, so adding a new regexp to `_validIframes` in a customization has no effect.

The best I’ve been able to come up with is to embed the iframe through Codepen. That works as a proof of concept, but the UI isn’t right for what we’re trying to do.

The goal is to be able to embed an iframe that’s generated on a WordPress site to create a map of the forum’s users. Something similar to what is outlined here: [Visual map of users - #8 by simon](https://meta.discourse.org/t/visual-map-of-users/44020/8)

Is this something that there is any demand for? If so, does anyone have an idea of how to approach it?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 31, 2017, 11:29pm UTC](https://meta.discourse.org/t/embed-an-iframe-on-a-discourse-hosted-site/56676/2 "2017-01-31T23:29:23Z")

</div>

The correct approach is the app to provide an `oembed`, so it will onebox and will be able to use an iframe inside the onebox.

Like a Google Maps uses an iframe:

https://maps.google.com/maps?ll=-23.6070449,-46.5407708&z=16&output=embed&dg=ntvb&q=Vila+Industrial,+S%C3%A3o+Paulo+-+State+of+S%C3%A3o+Paulo

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [February 1, 2017, 4:34am UTC](https://meta.discourse.org/t/embed-an-iframe-on-a-discourse-hosted-site/56676/3 "2017-02-01T04:34:28Z")

</div>

> [@Falco](#):
>
> The correct approach is the app to provide an oembed,

That looks very promising. The problem is that I’m creating the iframe on a WordPress site. It looks like it could be setup as an oembed provider, but I haven’t yet figured out how to do that.

For now, I’m just going to add the iframe to a post with javascript. That works well for what I need to do.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [February 1, 2017, 7:24am UTC](https://meta.discourse.org/t/embed-an-iframe-on-a-discourse-hosted-site/56676/4 "2017-02-01T07:24:46Z")

</div>

Actually, this Google Maps embed is broken for me. I should I be able to zoom and click the links, right? I cannot get any interaction out of the embed, it behaves like an image.
