# Set the image used for social network sharing?

**URL:** https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880
**Category:** Support
**Created:** [January 30, 2019, 5:22am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880 "2019-01-30T05:22:57Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [January 30, 2019, 5:22am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/1 "2019-01-30T05:22:57Z")

</div>

I want to be able to have a different image when people share a topic on social networks. How do I set it per page? Is there a plugin for this?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 30, 2019, 6:17am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/2 "2019-01-30T06:17:20Z")

</div>

Sharing uses the first image in the first post of the topic you linked to.

If you link to a post, sharing uses the first image of the first post you linked to.

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [January 30, 2019, 6:49am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/3 "2019-01-30T06:49:16Z")

</div>

Doesn’t seem that way. For example: [Wall St. Conference at Mar-a-Lago - #2 by Norman - News and Media - Intercoin](https://forum.intercoin.org/t/wall-st-conference-at-mar-a-lago/391/2) and [https://twitter.com/IntercoinOrg/status/1090483807067750401](https://twitter.com/IntercoinOrg/status/1090483807067750401)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 30, 2019, 6:51am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/4 "2019-01-30T06:51:59Z")

</div>

Let’s see

> **[Wall St. Conference at Mar-a-Lago](https://community.intercoin.app/t/wall-st-conference-at-mar-a-lago/391)**
>
> Jan 14-21 the cofounders of Intercoin were in Florida, at a conference put on by Jason Lyons. The year before, we had met some our main investors there, and were invited back for this year’s event, held in Mar-a-Lago. Needless to say, it was quite...

`https://forum.intercoin.org/t/wall-st-conference-at-mar-a-lago/391`

Looks correct to me. Note that the tweet links to the SECOND post in the topic.

`https://forum.intercoin.org/t/wall-st-conference-at-mar-a-lago/391/2`

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [January 30, 2019, 6:52am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/5 "2019-01-30T06:52:02Z")

</div>

Oh, perhaps because we customized the in the theme, to include some “meta” properties.

But if we didn’t do that, then posts without an image would not get any when shared.

What would be ideal is to have the option to set a default image for all forum pages (or even individual categories!) in some other tab of theme than “Customize CSS” and then override that meta if a topic has an image.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 30, 2019, 6:52am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/6 "2019-01-30T06:52:12Z")

</div>

See above answer. The link is wrong.

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [January 30, 2019, 6:53am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/7 "2019-01-30T06:53:23Z")

</div>

Wait, let me see one more time. I think what happened was… I edited the theme and commented out the tags when you posted the link. I hope it’s not cached now by this site:

> **[Wall St. Conference at Mar-a-Lago](https://community.intercoin.app/t/wall-st-conference-at-mar-a-lago/391)**
>
> Jan 14-21 the cofounders of Intercoin were in Florida, at a conference put on by Jason Lyons. The year before, we had met some our main investors there, and were invited back for this year’s event, held in Mar-a-Lago. Needless to say, it was quite...

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [January 30, 2019, 6:56am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/8 "2019-01-30T06:56:55Z")

</div>

@codinghorror yes, my above comment stands

We had to put meta tags in the theme header so topics without images would have a nice preview. But then every topic has this same image. How do we achieve both with the current software?

I will leave the tags in the theme, so you can reproduce it yourself (post the same link again).

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 30, 2019, 7:02am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/9 "2019-01-30T07:02:33Z")

</div>

Here’s what it should look like. The site logo will be used for the topic, but the author will be used if you deep link to a post in a topic, like so:

### Topic

> **[Toward a Better Markdown Tutorial](https://discourse.codinghorror.com/t/toward-a-better-markdown-tutorial/3178)**
>
> It's always surprised me when people, especially technical people, say they don't know Markdown. Do you not use GitHub? Stack Overflow? Reddit? This is a companion discussion topic for the original entry at...

### Post

> **[Toward a Better Markdown Tutorial](https://discourse.codinghorror.com/t/toward-a-better-markdown-tutorial/3178/2)**
>
> What we really need is a great Markdown tutorial and reference page, I think you have misidentified the problem. Even if there was a “great place”, no one is likely to go there - assuming you aren’t paying them or otherwise rewarding them for...

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [January 30, 2019, 7:05am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/10 "2019-01-30T07:05:08Z")

</div>

Yes, that’s good _in Discourse_ but I’m talking about posting links to Discourse topics in Facebook, Twitter and so on.

They don’t do what Discourse does, they show a blank image unless you put those tags. Try it. But once we put those meta tags, now they override everything.

I’m just saying, it would be a great idea for forums to have a field for a default image that is used when posting, but overridden when the topic has a better image. (And if you really want to get fancy, then topics can have one.)

The meta tags I’m talking about are og:image and twitter:card

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 30, 2019, 7:15am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/11 "2019-01-30T07:15:22Z")

</div>

This isn’t really correct.

For the topic case [https://cards-dev.twitter.com/validator](https://cards-dev.twitter.com/validator) shows

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/d/0dc1ae3c698a9a4bcd49818848b7c20a2e8b336e.png)

For the post case [https://cards-dev.twitter.com/validator](https://cards-dev.twitter.com/validator) shows

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/7/47c1ba14a73273a21ea71d02a5d44449e3f7dd5a.png)

I tend to agree that we should normalize behavior here, in the first case.. when no image exists in the first post, go ahead and use the site logo cc @techAPJ

But note that the link on your twitter refers to a post that does not exist:

`https://forum.intercoin.org/t/wall-st-conference-at-mar-a-lago/391/2`

There is no post #2 in that topic..

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [January 30, 2019, 7:23am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/12 "2019-01-30T07:23:04Z")

</div>

I agree regarding that. Just go to [Facebook.com](http://Facebook.com) and paste a link to a Discourse post with no images. Is it blank?

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [January 30, 2019, 7:24am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/13 "2019-01-30T07:24:24Z")

</div>

My apologies. Just tried it and Facebook seems to have changed its behavior, now it pulls the image correctly when sharing _this_ page.

If I want a large image, though, I would have to somehow set the meta og:image

Anyway… thanks for your attention!

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [January 30, 2019, 9:22am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/14 "2019-01-30T09:22:14Z")

</div>

I also wanted to say that I found the settings I was advocating are already in the Settings! Cool!

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [January 30, 2019, 9:37am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/15 "2019-01-30T09:37:30Z")

</div>

> [@codinghorror](#):
>
> If you link to a post, sharing uses the first image of the first post you linked to.

I like the way this works, and images in social shares are very effective.

However, I find that many first posts in topics don’t include images, so I have to massage my posts on Twitter and Facebook to include an image. This is a) fiddly and b) only benefits my social media shares and not other peoples’

I’d really appreciate a new feature allowing mods/admins to upload an image to assign to a topic for the purposes of social shares.

We could go in and edit people’s posts to include an image, but I have found people can take issue with the content of their posts being edited, understandably so. And they may not understand why their posts are being edited to include an image.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 30, 2019, 9:39am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/16 "2019-01-30T09:39:17Z")

</div>

> [@ChrisBeach](#):
>
> However, I find that many first posts in topics don’t include images, so I have to massage my posts on Twitter and Facebook to include an image. This is a) fiddly and b) only benefits my social media shares and not other peoples’

As already stated above, we’re going to change it so the site logo is used for topic links if there are no images in the first post, since that’s how Discourse oneboxes other Discourse instances already, see examples posted earlier in this very topic.

However for deep links to individual posts, the user avatar will still be used if the post does not contain an image.

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [January 30, 2019, 9:41am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/17 "2019-01-30T09:41:08Z")

</div>

> [@codinghorror](#):
>
> we’re going to change it so the site logo is used for topic links if there are no images in the first post

Yes, I can already get this behaviour by setting the default OG image.

However, this isn’t as engaging or topical as an image that’s tailored to the topic in hand.

It would be great for mods/admins to be able to upload and assign an image per topic

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 30, 2019, 9:41am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/18 "2019-01-30T09:41:44Z")

</div>

Yes, and they can do that by editing the first post, or changing the site’s logo.

> [@ChrisBeach](#):
>
> It would be great for mods/admins to be able to upload and assign an image per topic

This is not on any of our roadmaps for the forseeable future.

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [January 30, 2019, 9:43am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/19 "2019-01-30T09:43:36Z")

</div>

> [@codinghorror](#):
>
> This is not on any of our roadmaps for the forseeable future.

No worries. I may see if I can reuse the image upload code from core settings, and the Topic List Previews code that @angus wrote and perhaps I can knock up a plugin to achieve this.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [January 30, 2019, 9:45am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/20 "2019-01-30T09:45:58Z")

</div>

> [@codinghorror](#):
>
> I tend to agree that we should normalize behavior here, in the first case… when no image exists in the first post, go ahead and use the site logo

Currently if the topic first post does not have an image we are defaulting to `opengraph_image` setting. I’ll modify the code to use `logo` if the `opengraph_image` setting is blank. So the priority for topic opengraph image will be: `first post image > opengraph_image > logo`.

[Next page](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880.md?page=2)
