Change default sharing image

AI-generated summary

The discussion revolves around changing the default open graph image when sharing forum posts. cookywook noted that sharing a specific post URL displays the poster’s avatar instead of a more suitable image. david explained that updating the ‘large icon’ in the branding settings can set the default image. He later identified the issue in the code, where the avatar takes precedence over the open graph image for post-level shares. zogstrip supported prioritizing the open graph image. david proposed and implemented a fix to align post-level shares with topic-level behavior, ensuring the open graph image is used instead of the avatar. cookywook thanked david for the quick fix, though cookywook later asked why the image size is smaller than when sharing the entire thread, prompting david to request an example link.

When we share forum posts elsewhere, the open graph image defaults to the avatar of the poster, which doesn’t look great.

Is there a way to change it to something else by default?

I searched for other posts on this and only found this, which didn’t get answered:

If you head to the “branding” tab of your site settings, you will find various places to upload logos. If you update the ‘large icon’, it will propagate to all the other sharing icons.

I just took a look at the code, and I guess you are talking about the case when you share a specific post URL. For example, if I share the link to this topic, it would look like (using the twitter card validator)

However, if I share the permalink to my reply, we get my profile picture:

I think in this case we should prioritise the default opengraph image over the avatar. What do you think @zogstrip?

I meant exactly this, correct!

So this would be: first image in the post :arrow_right: open graph image :arrow_right: poster avatar?

I guess poster avatar will almost never show…
But I think having the open graph image makes more sense :+1:

I was actually thinking of removing the post avatar entirely. Almost every site will have some kind of opengraph image set. I don’t think anyone really wants profile pictures showing up as link previews anyway:

https://github.com/discourse/discourse/pull/8605

This change is now made. Links to replies will now fall back in the same way as links to the topic itself. So my reply above now looks like:

I’ve just deployed this change to your hosted site @cookywook - thanks for starting the discussion!

Amazing, thanks for the hyper-speedy turnaround :slight_smile:

One more thing, sorry, do you know why it makes just a little image rather than the big one you’d get if you shared the whole thread?

Hmm not sure, do you have an example link? (feel free to PM if you’d rather not post it in public)