# What is the order of priority of image previews for discourse links on twitter?

**URL:** https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303
**Category:** Support
**Created:** [December 1, 2022, 8:26am UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303 "2022-12-01T08:26:37Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Sectros](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Sectros](https://meta.discourse.org/u/Sectros)
#### Post date: [December 1, 2022, 8:26am UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303/1 "2022-12-01T08:26:37Z")

</div>

I know that when you post a link to your forum on Twitter, and if the linked post contains a Image or more, the preview of the thread on Twitter will show that image or the first image in the thread as the thumbnail for the preview.

I have also read that there are “categories images” which can be shown as the thumbnail, and also there is a “twitter summary large image” option in the site settings, however I have never been able to see any of these latter two at work as thumbnails on twitter, because if there is no image in the body of the forum post itself, the thumbnail I get is just the default gray image with an icon in the center, to the felt pf the text preview.

So, how can I control which image is displayed as the topic thumbnail on Twitter?

Your help will be much appreciated.

ps: twitter api keys are stored and twitter login is working.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [December 1, 2022, 9:49am UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303/2 "2022-12-01T09:49:36Z")

</div>

Hello,

There are several settings for this.

1. `opengraph image`
2. `twitter summary large image`
3. `category logo image`
4. post first image

* * *

The `opengraph image` is the base. If you only set up this then it will appear if there is no post or category image.

If you set up a `twitter summary large image` then it will override the `opengraph image` on Twitter. So it will appear on Twitter instead of `opengraph image`.

The category logo image and post first image always take priority over the others.

* * *

**Priority order:**

1. post first image and category logo image  
(if missing) 🔽

2. `twitter summary large image`  
(if missing) 🔽

3. `opengraph image`  
(if missing) 🔽

4. `large icon`

(if I am right)

* * *

**Configure**

The `opengraph image` and `twitter summary large image` you can set up here: `/admin/site_settings/category/branding`

 ![Screenshot 2022-12-01 at 10.20.06](https://global.discourse-cdn.com/meta/original/4X/3/4/b/34b2485da811058e5181f2e8366f2fd7d293ed5e.png)

* * *

For the category logo image go to the specific category settings Images tab.

 ![Screenshot 2022-12-01 at 10.21.38](https://global.discourse-cdn.com/meta/original/4X/5/c/6/5c6e608f47dfe8ec34d5b9d4621e974953408d7d.png)

* * *

> **Tests on Twitter**
>
> I share a post link which has no contain image and with `twitter summary large image` setting 🔽
> 
> ![Screenshot 2022-12-01 at 10.24.55](https://global.discourse-cdn.com/meta/original/4X/9/6/0/960d7c5aa05d51a6a92d2f9438dbe4f2d1ac8f59.png)
> 
> I share a post link which contain image and with `twitter summary large image` setting 🔽
> 
> ![Screenshot 2022-12-01 at 10.26.55](https://global.discourse-cdn.com/meta/original/4X/8/4/4/8444a321b425211e11968c231c461750a617860f.png)
> 
> I share a post link which not contain image and no `twitter summary large image` but I seted up an `opengraph image`
> 
> ![Screenshot 2022-12-01 at 10.30.08](https://global.discourse-cdn.com/meta/original/4X/1/3/3/1339503bfaf9f9aab5cd105ffba0adf4a80ef354.png)
> 
> I share a category link which contains `category logo image`
> 
> ![Screenshot 2022-12-01 at 12.02.51](https://global.discourse-cdn.com/meta/original/4X/a/9/c/a9ce6a29358f2a61856061880d1fa8d1834ae408.png)
> 
> Share site link without `opengraph image` and other setting.
> 
> ![Screenshot 2022-12-01 at 10.34.03](https://global.discourse-cdn.com/meta/original/4X/e/b/1/eb1b841ee95e2ed8954bcad0a6631944e40aa6f3.png)

* * *

Hope this helps 🙂

---

<div class="post-metadata">

### Author: ![arejay](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@arejay](https://meta.discourse.org/u/arejay)
#### Post date: [February 13, 2023, 3:06pm UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303/3 "2023-02-13T15:06:51Z")

</div>

So, I am struggling with this. I have two posts that behave differently and I can’t figure out why. One post shows the onebox preview image in twitter. The other shows the twitter\_summary\_large \_image.

This post works as expected.  
[https://community.abs-consulting.com/t/welcome-to-issue-65-of-the-abs-devops-scm-e-newsletter/22](https://community.abs-consulting.com/t/welcome-to-issue-65-of-the-abs-devops-scm-e-newsletter/22)

This post does not work as expected.  
[https://community.abs-consulting.com/t/devsecops-platforms-help-smbs-scale-as-they-grow/113](https://community.abs-consulting.com/t/devsecops-platforms-help-smbs-scale-as-they-grow/113)

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 14, 2023, 4:24pm UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303/4 "2023-02-14T16:24:27Z")

</div>

Welcome robert 👋 🙂

I see regular oneboxes for both:

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/1/f/21f11ac075c4487dc1626eee7bcf501173b9c8a3.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/b/a/c/bacf580f32b4ff3525f2050812bb83042869e7ed.png)

---

<div class="post-metadata">

### Author: ![arejay](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@arejay](https://meta.discourse.org/u/arejay)
#### Post date: [February 14, 2023, 4:52pm UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303/5 "2023-02-14T16:52:07Z")

</div>

Yes. That piece works. But it when it is shared to social networks I get different behavior.

 ![Screenshot 2023-02-14 at 11.47.22 AM](https://global.discourse-cdn.com/meta/original/4X/1/4/3/14306dfb314f29c40f04ae55cbb463e836d772be.png)

 ![Screenshot 2023-02-14 at 11.48.47 AM](https://global.discourse-cdn.com/meta/original/4X/b/3/8/b388bbefbe2aa9773a7756b052815f9576579fed.png)

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 14, 2023, 5:04pm UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303/6 "2023-02-14T17:04:58Z")

</div>

Each website has its own way to select the image that will be used as a thumbnail when displaying a preview.

Usually, a meta tag specifies an image and it’s the first choice.

Your link doesn’t have such tags, and thus various websites will pick an image from the page HTML based on their own criteria.

I don’t know how Discourse specifically chooses which image to use. It may even build a composite image from various HTML parts. 🤷

---

<div class="post-metadata">

### Author: ![arejay](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@arejay](https://meta.discourse.org/u/arejay)
#### Post date: [February 15, 2023, 3:09pm UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303/7 "2023-02-15T15:09:02Z")

</div>

Ok, that makes sense. But I would expect the two post to behave the same. Unless discourse or twitter is somehow parsing the link onebox has presented and then looking for the meta tag from there and not from the discourse post? That might explain why the first post may link to a webpage that has defined meta-tag where the second post that inbox is referencing does not.

> [@Canapin](#):
>
> Your link doesn’t have such tag

Are you saying here that the Discourse post does not have the ‘meta-tag’ or the link that onebox is referencing does not have the ‘meta-tag’?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 15, 2023, 3:48pm UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303/8 "2023-02-15T15:48:26Z")

</div>

> [@arejay](#):
>
> the link that onebox is referencing does not have the ‘meta-tag’?

I’m talking about this. The page you share should have the proper meta tags that will be used on most platforms (twitter, facebook, discord, discourse, etc etc). 🙂

I thinks this is a good resource to learn about this:

> **[The Essential Meta Tags for Social Media | CSS-Tricks](https://css-tricks.com/essential-meta-tags-social-media/)**
>
> These days, almost every website encourages visitors to share its pages on social media. We’ve all seen the ubiquitous Facebook and Twitter icons, among

---

<div class="post-metadata">

### Author: ![arejay](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@arejay](https://meta.discourse.org/u/arejay)
#### Post date: [February 15, 2023, 3:59pm UTC](https://meta.discourse.org/t/what-is-the-order-of-priority-of-image-previews-for-discourse-links-on-twitter/247303/9 "2023-02-15T15:59:39Z")

</div>

Looks like I was able to resolve the issue. I had to change the setting, Files \>\> download remote images to local. This is now enabled. I tested by disabling creating a topic. Reenable, create a duplicate topic. Next I checked the thumbnail image in both topics. One is referencing the local image store. The other is referencing the remote image from the link.

Next I sharing each topic to a social network, linked-in cause the preview works. In the case with the local image store. The LinkedIn preview picks-up the local image from my community. The other gives serves the opengraph\_image from settings and not the thumbnail image from the link site.

So, it appears I need to have the setting, Files \>\> download remote images to local, enabled to show the preview image from onebox propagated to the social network when sharing links.
