Facebook image for topics not showing correctly


(Ian Freeman) #1

Despite my “default opengraph image url” field in the settings being filled properly, a topic page from my discourse returns this error in the facebook scraper:

“The ‘og:image’ property should be explicitly provided, even if a value can be inferred from other tags.”

Facebook instead chooses the forum header image for its preview image, rather than the opengraph image I have set.

Am I missing something? Thanks!


(Jeff Atwood) #2

Is there something unusual about this topic page? Does it work OK with other topic pages?


(Ian Freeman) #3

I’ve tried a couple. It does not work with them. However, it works right with the main URL of the site.

Thought it might have to do with the fact that most of the forums are closed to the public, so I tried with one of the public forum posts, it also does not show up correctly on that.


(Jeff Atwood) #4

What version of Discourse?


(Ian Freeman) #5

URLs as examples:

Main URL:

Public thread:

Non-public thread:
http://forum.shiresociety.com/t/target-hiring-all-shifts/9035/1


(Jeff Atwood) #6

Looks like a recent version so @techapj can advise you.


(Ian Freeman) #7

It’s version 1.7.0.beta7


(Arpit Jalan) #8

In that case OpenGraph tags will not be created when crawled as non-authorized user.

In case of “post” link if that post has image then that will be used as og image, otherwise avatar of user who created that post will be used as opengraph image.

In case of “topic” link if that topic has image then that will be used as og image, otherwise “default opengraph image url” will be used as opengraph image.

In case of main site URL “default opengraph image url” will always be used as opengraph image.

I hope this makes it clear.


(Ian Freeman) #9

Thanks for the info, but that doesn’t seem to be the case with a link to a public topic.

Here’s facebook’s scrape for a public topic:

https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fforum.shiresociety.com%2Ft%2Fmoved-here-and-introduction%2F9028%2F3

And here’s the scrape for the front page:

https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fforum.shiresociety.com

and here’s a link to a post on a public topic:

https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fforum.shiresociety.com%2Ft%2Frequired-introduction%2F9014%2F4%3Fu%3Dftl_ian

The default og image should be:

not:

Thanks!


(Arpit Jalan) #10

Thanks for detailed report.

That is actually a scrape for public post … notice the URL .../9028/3. I just verified the scrape for that topic looks good via: Sharing Debugger - Facebook for Developers

Looks good! :thumbsup:

Okay, I just noticed this Facebook warning:

Provided og:image URL, http://forum.shiresociety.com/user_avatar/forum.shiresociety.com/penguin/100/4_1.png was not valid because it did not meet the minimum size constraint of 200px by 200px.

This issue is now fixed via:

Now the og:image tag (for that post) will contain 200px by 200px image of user avatar which will be valid on Facebook.

Thanks for bringing this issue in our notice. :thumbsup:


(Ian Freeman) #11

Oh, oops. I was just right clicking the topic names. Didn’t notice that would give me the link to the latest post.

Regarding that fix, I have to edit a file on the server to make that happen? Thanks!


(Arpit Jalan) #12

Nope, just visit /admin/upgrade and update your instance to latest version. :slight_smile:

More info here:


(Ian Freeman) #13

That solved that, thank you.


(Emilio F Castillo) #14

Your post help me solve my issue.