# Onebox for WordPress 4.4 sites

**URL:** https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765
**Category:** Feature
**Created:** [December 16, 2015, 12:10am UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765 "2015-12-16T00:10:15Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![AdamCapriola](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adamcapriola/32/5192_2.png) [@AdamCapriola](https://meta.discourse.org/u/AdamCapriola)
#### Post date: [December 16, 2015, 12:10am UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/1 "2015-12-16T00:10:15Z")

</div>

Onebox used to work great for my site, but last week (I’m pretty sure after I upgraded to 4.4) it stopped working so nicely:

> **["Silver Surfer" – Back-to-Back Runner-up Reports, A Fiery Standout, and Some...](https://sixprizes.com/2015/12/15/silver-surfer/)**
>
> Hello SixPrizes readers! It’s a pleasure to write for you once again, discussing my latest thoughts and theories. We are now three weeks into one of my favorite parts of Pokémon, City Championships. I was able to go to two City Championships over the...

The [Iframely](http://iframely.com/debug?uri=http%3A%2F%2Fsixprizes.com%2F2015%2F12%2F15%2Fsilver-surfer-back-to-back-runner-up-reports-a-fiery-standout-and-some-potential-plays%2F) previews look ok except for the oEmbed HTML — it looks weird.

This seems relevant: [https://make.wordpress.org/core/2015/10/28/new-embeds-feature-in-wordpress-4-4/](https://make.wordpress.org/core/2015/10/28/new-embeds-feature-in-wordpress-4-4/)

I guess there’s a plugin to disable the new embed functionality, but I doubt many people are going to think of doing (or want to do) that.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 16, 2015, 12:10am UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/2 "2015-12-16T00:10:55Z")

</div>

Sure, we should support both earlier WordPress and WordPress 4.4 here @techapj can you add to your list?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [December 16, 2015, 5:34pm UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/3 "2015-12-16T17:34:21Z")

</div>

The above WordPress onebox looks good on try:

> **[How do I reply to folks here?](https://try.discourse.org/t/how-do-i-reply-to-folks-here/51/8?u=techapj)**
>
> I noticed there’s a few different ways to reply. I’m unclear which method of replying I should use, and when. Can anyone clarify this for me? Also how do I quote someone else’s post, as I have seen others do in replies here?

It’s broken here on meta because `http://sixprizes.com` (WordPress blog) does not have SSL enabled, hence causing this error:

```plaintext
Mixed Content: The page at 'https://meta.discourse.org/t/onebox-broken-for-wordpress-4-4-sites/36765/2' was loaded over HTTPS, but requested an insecure resource 'http://sixprizes.com/2015/12/15/silver-surfer-back-to-back-runner-up-reports-a-fiery-standout-and-some-potential-plays/embed/'. This request has been blocked; the content must be served over HTTPS.

```

* * *

@AdamCapriola If your Discourse instance has SSL enabled than the accompanying WordPress blog should also have SSL enabled for embeds to work properly.

---

<div class="post-metadata">

### Author: ![AdamCapriola](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adamcapriola/32/5192_2.png) [@AdamCapriola](https://meta.discourse.org/u/AdamCapriola)
#### Post date: [December 16, 2015, 8:19pm UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/4 "2015-12-16T20:19:57Z")

</div>

Oh, huh. Maybe they are working. The only other link I’d showed up like this and I assumed something was broken:

> **[How do I reply to folks here?](https://try.discourse.org/t/how-do-i-reply-to-folks-here/51/9?u=adamcapriola)**
>
> I noticed there’s a few different ways to reply. I’m unclear which method of replying I should use, and when. Can anyone clarify this for me? Also how do I quote someone else’s post, as I have seen others do in replies here?

I guess the height is just off (the title and except aren’t shown — featured image is too big). Is that a WordPress issue?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 16, 2015, 8:49pm UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/5 "2015-12-16T20:49:40Z")

</div>

Also [http://blog.discourse.org](http://blog.discourse.org) is latest WordPress so we can test with that too.

We’re supposed to onebox URLs in the form

`http://blog.discourse.org/2015/12/discourse-selected-for-mozilla-open-source-support-program/`

Where it is  
`http://example.com/yyyy/mm/slug/`

Because we assume they are WordPress..

Why isn’t that happening, @techapj?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [December 17, 2015, 6:48am UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/6 "2015-12-17T06:48:51Z")

</div>

> [@codinghorror](#):
>
> We’re supposed to onebox URLs in the form
> 
> [Discourse selected for Mozilla Open Source Support program](http://blog.discourse.org/2015/12/discourse-selected-for-mozilla-open-source-support-program/)
> 
> Where it is [http://example.com/yyyy/mm/slug/](http://example.com/yyyy/mm/slug/)

Currently we were only oneboxing WordPress links with `../yyyy/mm/dd/..` permalinks, just added support for `../yyyy/mm/..` permalinks too:

[https://github.com/discourse/onebox/commit/f66b171cc79e067022d457d62a0883b33383c9c2](https://github.com/discourse/onebox/commit/f66b171cc79e067022d457d62a0883b33383c9c2)

* * *

Posts from [http://blog.discourse.org](http://blog.discourse.org) are still not getting oneboxed because we are not providing oEmbed endpoint, will modify our WordPress theme to include oEmbed endpoint for posts.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [December 17, 2015, 7:09am UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/7 "2015-12-17T07:09:26Z")

</div>

> [@AdamCapriola](#):
>
> I guess the height is just off (the title and except aren’t shown — featured image is too big). Is that a WordPress issue?

Seems like it.. Here is the WP iframe source: [“Build-A-Bat” — Crafting Crobat for Competitive Play, Meta Updates, and Rogue Highlights — SixPrizes](http://sixprizes.com/2015/12/10/build-a-bat-crafting-crobat-for-competitive-play-meta-updates-and-rogue-highlights/embed/)

Notice that there is no `max-width` CSS property on image, and the iframe height is fixed `height="338"`.

---

<div class="post-metadata">

### Author: ![AdamCapriola](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adamcapriola/32/5192_2.png) [@AdamCapriola](https://meta.discourse.org/u/AdamCapriola)
#### Post date: [December 17, 2015, 4:01pm UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/8 "2015-12-17T16:01:59Z")

</div>

Hmm. Yeah idk why the height is wrong. The image size is actually ok. When I try to embed the post in WordPress it looks fine.

Either way, the blockquoted link above the embed should be hidden, right?

```css
blockquote.wp-embedded-content {
    display: none;
}

```

* * *

Height appears to be 338 for anything (notice the whitespace below this embed):

> **[New Embeds Feature in WordPress 4.4](https://make.wordpress.org/core/2015/10/28/new-embeds-feature-in-wordpress-4-4/)**
>
> WordPress has been operating as an oEmbed consumer for quite some time now, allowing users to easily embed content from other sites. Starting with version 4.4, WordPress becomes an oEmbed provider …

It resizes inside of WordPress posts though (visit that link and watch the page load). So maybe there’s something going on in Discourse preventing it from resizing correctly?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 17, 2015, 9:20pm UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/9 "2015-12-17T21:20:32Z")

</div>

We absolutely do not want embedded variable height content as it destroys our infinite scrolling – ask @techapj about Twitter embeds for this reason. If it is variable height, it cannot be allowed.

---

<div class="post-metadata">

### Author: ![AdamCapriola](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adamcapriola/32/5192_2.png) [@AdamCapriola](https://meta.discourse.org/u/AdamCapriola)
#### Post date: [December 17, 2015, 9:39pm UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/10 "2015-12-17T21:39:29Z")

</div>

Got it. So I guess for consistency we want to enforce WordPress links as they behaved previously then? (OpenGraph instead of oEmbed)

Is that possible or is this in the hands of the WP install?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 17, 2015, 9:41pm UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/11 "2015-12-17T21:41:18Z")

</div>

It needs to behave like Twitter where we grab the content and render it. We cannot have alien Iframes of varying height ruining all scrolling.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [January 17, 2016, 7:45pm UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/12 "2016-01-17T19:45:38Z")

</div>

Okay, I just fixed this issue via

[https://github.com/discourse/onebox/commit/1b8bef8f96a4353cdfa6bc67da87d6750d5d31bf](https://github.com/discourse/onebox/commit/1b8bef8f96a4353cdfa6bc67da87d6750d5d31bf)

Now in case of WordPress embeds onebox will use OpenGraph data instead of oEmbed (so as to avoid weird iframes).

* * *

Here’s the above WordPress link with OpenGraph data:

> **["Silver Surfer" – Back-to-Back Runner-up Reports, A Fiery Standout, and Some...](https://sixprizes.com/2015/12/15/silver-surfer/)**
>
> Hello SixPrizes readers! It’s a pleasure to write for you once again, discussing my latest thoughts and theories. We are now three weeks into one of my favorite parts of Pokémon, City Championships. I was able to go to two City Championships over the...

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [December 4, 2025, 11:37am UTC](https://meta.discourse.org/t/onebox-for-wordpress-4-4-sites/36765/13 "2025-12-04T11:37:10Z")

</div>


