Change default sharing image

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:

2 Likes

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.

4 Likes

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?

https://github.com/discourse/discourse/blob/6261339da9def45e435c7d6bdc0ee1090cc2bb48/lib/topic_view.rb#L238-L249

3 Likes

I meant exactly this, correct!

3 Likes

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:

3 Likes

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

3 Likes

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!

6 Likes

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

3 Likes

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?

1 Like

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

1 Like

This topic was automatically closed after 3 days. New replies are no longer allowed.