• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Facebook share image selection


Active member
Yes, I know this topic has been discussed, many, many times. But I have what I think is an odd predicament, not sure how to resolve it.

A couple months ago, I found some instruction somewhere here on the XF boards to make it so that instead of grabbing my site logo image for Facebook thumbnails, it would let the user pick an image. That worked great. The problem now is that for some reason, Facebook is only seeing images when they are linked to the thread from outside of my site. So if someone posts photos that are hosted from Flickr, the images show up on Facebook. But if they uploaded them to my site, absolutely nothing comes up on Facebook, not even the site logo.

I don't know what changed that broke the functionality as it was all working a few weeks ago. I figure I need to determine what changes I made before in order to get to the root of the problem but I cannot for the life of me find it. I've found a few threads that detail solutions that might work for me but when I check my templates, the code does not match.

Specifically, I thought this template edit by @Jake Bunce might have been the one I used but neither the original or modified code is in my thread_view template.


Any ideas on how I can fix this?


Thread example with photos uploaded to my site (no thumbnails on FB):

Thread example with linked photos from Flickr (lots of thumbnails to choose from):

Jake Bunce

XenForo moderator
Staff member
The page has no og information in the head. That might be it.

The og information will only be included if you have entered an app id or admin:

Admin CP -> Home -> Options -> Facebook Integration


Active member
I would also love to have facebook pull images from threads when sharing rather than my facebook share logo.
Same here! This is what happened when someone shared a thread on my old PunBB forum - Facebook would scan the link, and any images it found therein (i.e. any avatars, or images posted within the thread) would be listed as possible thumbnails to choose to display on Facebook.

It would be great if I could once again do this since migrating to XenForo. :)


Active member
Yes. Like many, I absolutely can't believe this isn't a 4-alarm fire for XenForo to add to the core functionality. Half of the coolness of posting a link on Facebook is the fact that a little preview shows up next to it. People need that visual stimulation! Social networking is critical in promoting growth for any forum. Perhaps a lot of forums don't have many photos as a key part of their content, but for those that do, this is a should be a quick deal breaker.

So back to trying to at least get my setup back to the default of showing the crappy site thumbnail...

Jake, do you know where I should look to find out why it's not even showing the OG thumbnail?

Jake Bunce

XenForo moderator
Staff member
The og:image and other og information will only be included in the page if you have entered an app id or admin in the facebook settings:

Admin CP -> Home -> Options -> Facebook Integration

Otherwise no og information will be shown.

In addition to this, if you wish to choose an image from the page at the time of sharing the link then you need to remove the og:images from this template:

Admin CP -> Appearance -> Templates -> open_graph_meta

Rich (BB code):
<xen:if is="{$xenOptions.facebookAppId} OR {$xenOptions.facebookAdmins}">
	<meta property="og:site_name" content="{$xenOptions.boardTitle}" />
	<xen:if is="{$avatar}"><meta property="og:image" content="{$avatar}" /></xen:if>
	<meta property="og:image" content="{xen:helper fullurl, @ogLogoPath, 1}" />
	<meta property="og:type" content="article" />
	<meta property="og:url" content="{xen:raw $url}" />
	<meta property="og:title" content="{xen:raw $title}" />
	<xen:if is="{$xenOptions.facebookAppId}"><meta property="fb:app_id" content="{$xenOptions.facebookAppId}" /></xen:if>
	<xen:if is="{$xenOptions.facebookAdmins}"><meta property="fb:admins" content="{xen:helper implode, {$xenOptions.facebookAdmins}, ','}" /></xen:if>
It should allow you to choose an image when no og:image is defined (so I'm told, but I don't use facebook).


Active member
That template mod would be great. The problem is, I already changed something a couple months ago and I can't figure out what I changed.

When I post a thread to FB with photos hosted OUTSIDE of my XenForo install, it lets me choose the photo. Anything that users uploaded directly into XF, no longer appears as of a few weeks ago.

So any ideas where I might find how to at least revert to the standard crappy way of handling thumbnails on FB that XF does out of the box so that I can then try that mod? I've searched and searched and I can't find the template edit that I made before.

Isn't it clear that many XF admins are desperate for this functionality? I can think of nothing I would like added to the core functionality more. Why isn't this being addressed by XF?


Active member
Thinking more about this. I'm pretty sure the functionality broke when I changed to full friendly URLs. Is Facebook not seeing them because of that perhaps? Any ideas on how to get around that? I love the full friendly URLs but without the facebook images it's got to go.


Active member
My suspicion is now confirmed. Full friendly URLs breaks whatever mod I made to allow facebook users to choose the thumbnail from the thread. I turned them off and everything is working fine. So I guess the big question now is how to make full friendly URLs work and still keep my Facebook thumbnails rocking.