Onebox doesn't work for WordPress

(Bcguy) #1

Hi Guys,

I still have a problem with another plugin/gem. My main website is based on wordpress - but a long time ago I set up the posts to have the URL format like this:

Is there anyway that I can get my discourse forum to onebox these URLs?



(Régis Hanol) #2

You need to properly implement either OpenGraph or oEmbed.

Onebox doesn' work for prestashop
(Bcguy) #3

Are you saying the Wordpress only implements opengraph or oEmbed with one form of URL? It works fine with URLs that include the title name, but not the URL format I have - why would that be?

(Matt Palmer) #4

Do you have an example URL that does embed properly, preferably a working version of that same page, for comparison? It looks like Wordpress is trying to use OpenGraph, but the OG spec says:

The four required properties for every page are: og:title […] og:type […] og:image […] og:url

The only one that page is displaying for me is og:image, which is why we’re not oneboxing that URL properly. If Wordpress is presenting all the OG meta tags on one version of the page, but not on another, that would be… weird, but something you’d have to take up with Wordpress.

(Jay Pfaffman) #5

I am not a WordPress expert.

Because either oEmbed or Discourse won’t read past the ?.

I’m pretty sure that if you turn on any permalinks other than “plain” your problem will be solved. It won’t hurt anything because the old ?p=xxx links will continue to work (but remember I’m not an expert, so you should check this after you turn on permalinks).


Here’s one from my site:

(Simon Cossar) #6

WordPress oneboxes will work using the plain (post number) permalink structure. I think the issue you’re having is the lack of OpenGraph tags on the page. An easy way to get OpenGraph tags on your site is to install the Yoast SEO plugin. Here’s an example that uses the post-number permalink structure - first with the Yoast SEO plugin enabled, and then a similar post, but with Yoast SEO disabled.