# האם לדרוס את מקור התמונה של meta og:image כדי להשתמש בתמונות שנטענו באופן ציבורי חיצוני בנושאים?

**URL:** https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257
**Category:** Feature
**Created:** [26 באוקטובר,‏ 2020,‏ 9:09am UTC](https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257 "2020-10-26T09:09:22Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Faizan\_Zahid](https://avatars.discourse-cdn.com/v4/letter/f/b9bd4f/32.png) [@Faizan\_Zahid](https://meta.discourse.org/u/Faizan_Zahid)
#### Post date: [26 באוקטובר,‏ 2020,‏ 9:09am UTC](https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257/1 "2020-10-26T09:09:22Z")

</div>

Basically you can see my problem and discussion with plugin author @merefield here ,

> [@Topic List Previews (legacy)](https://meta.discourse.org/t/topic-list-previews/101646/1342):
>
> Hey robert, Many Thanks for your quick reply. Yes that is good, images must be still detected by discourse core like your plugin does even if they are hosted on external public sites. This is exactly what i want discourse core to support, where can i request this feature? Basically all my topic images are loaded from other external public sites like imgur, [https://pixabay.com/](https://pixabay.com/) and other free sites which allow us to use images for free. Im not using any object storage, So i never upload the…

He recommends me to request Discourse team to do this for us.

I always use external CDN images on my site, i never upload them on local upload or on object storage because that is too expensive so save images locally or on S3 buckets.

Right now, i can see that my meta og:image tag is not picking up these images, e.g see my this topic [How Many Carbs on Keto? - How To Discuss](https://howtodiscuss.com/t/how-many-carbs-on-keto/28069)

The image is actually loaded from an external public URL as its IMG SRC. The social media Open graph is always showing my site logo as fall back image, which is not good.

Because of this core discourse behaviour, i don’t see these thumbnails images as detected by the topic list preview plugin too.

How can i overwrite the meta og:image tag to force use my externally uploaded image?

So that i can see the **ACTUAL TOPIC IMAGE** instead of my site forum logo when i share it on social media sites [https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Fhowtodiscuss.com%2Ft%2Fis-yoga-a-good-workout%2F28043](https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Fhowtodiscuss.com%2Ft%2Fis-yoga-a-good-workout%2F28043)

I did try to force add this line on my topic page,

`<meta property="og:image" content="https://images.pexels.com/photos/4761347/pexels-photo-4761347.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500" />`

but og:image tag when i see the source of the page is still using my site logo as fallback, it thinks that there is no image on this topic ☹

The 1st image on any topic’s 1st post must be picked up my meta og:image tag even if the image hosted on some public URL. Right now it only picks up if the image is uploaded on my own server.. but many of us cannot afford to do image hosting ourselves as its too expensive. Help from discourse team to allow this change for us will be very helpful.

@Bcat is having the same problem on his forum.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [26 באוקטובר,‏ 2020,‏ 10:01am UTC](https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257/2 "2020-10-26T10:01:13Z")

</div>

Discourse core only supports using ‘uploads’ as topic thumbnails. They can be local, or hosted on S3, but they must be uploaded to discourse. You can automatically turn hotlinked images into uploads using the “download remote images to local” site setting.

I’m afraid we don’t have any plans to change this behaviour in Discourse.

---

<div class="post-metadata">

### Author: ![Faizan\_Zahid](https://avatars.discourse-cdn.com/v4/letter/f/b9bd4f/32.png) [@Faizan\_Zahid](https://meta.discourse.org/u/Faizan_Zahid)
#### Post date: [26 באוקטובר,‏ 2020,‏ 11:43am UTC](https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257/3 "2020-10-26T11:43:38Z")

</div>

> [@david](#):
>
> Discourse core only supports using ‘uploads’ as topic thumbnails. They can be local, or hosted on S3, but they must be uploaded to discourse.

If they are hosted on S3, then how are they uploaded on Discourse? S3 is not on Discourse, it is also a public server to host images. When i use remote images from 3rd party free image public CDNs then they are also accessible by anyone, same with S3. Then why does Discourse not allow / support the public images URLs to be used as topic thumnails?

E.g this URL [https://global.discourse-cdn.com/meta/optimized/3X/7/1/71abcfa01874c32497d638b372f94c7b9fc021e4\_2\_1380x718.png](https://global.discourse-cdn.com/meta/optimized/3X/7/1/71abcfa01874c32497d638b372f94c7b9fc021e4_2_1380x718.png)  
is the picture i just uploaded on meta discourse right now, and this is a public image hosting URL, and my own images URLs look like [https://images.pexels.com/photos/4761347/pexels-photo-4761347.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500](https://images.pexels.com/photos/4761347/pexels-photo-4761347.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500)

and my URLs are also public hosted images, why is discourse not picking mine? Please configure it to use both of them, because as a crawler or open graph crawler both images sources are publicly hosted URLs.

> [@david](#):
>
> You can automatically turn hotlinked images into uploads using the “download remote images to local” site setting.

I have already turned this setting on,

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/e/fe8ae38a61e3836b35633317f73ddb8c717bafe2.png)

but then why my hotlinked images are not being taken as topic thumbnails?

i have also disabled jpg/jpeg uploads in this file setting,

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/1/71abcfa01874c32497d638b372f94c7b9fc021e4.png)

i have disabled this to avoid users uploading images directly on my server to save storage space.

As if my forum gets very big, it will become very hard for me to manage storage for soo much images.

Is there any hacky/trick to acheive what i want? i just want to force overwrite the og:image meta tag to use my hotlinked image in topic. How can i simply acheive this? perhpas any HTML code i can put on topic pages to force use this hotlink image src for og:image?

OR can i add a line of code in my site to prevent default or simply remove this meta og:image line which falls back to logo image if discourse fails to detect topic thumbnail?

I tried adding this below line in my topic page post editor

`<meta property="og:image" content="https://images.pexels.com/photos/4761347/pexels-photo-4761347.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500" />`

but for some reason, this code is not being rendered when i see the source code of my topic page, why is that?

this is the page i tried this on [Is yoga a Good workout - How To Discuss](https://howtodiscuss.com/t/is-yoga-a-good-workout/28043)

How can i prioritise this 1, so that if my page has 2 meta og:image tags, then it should only pick and use **MY CUSTOM** meta og:image tag?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [26 באוקטובר,‏ 2020,‏ 11:47am UTC](https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257/4 "2020-10-26T11:47:29Z")

</div>

> [@Faizan\_Zahid](#):
>
> If they are hosted on S3, then how are they uploaded on Discourse?

By setting it up like this:

> [@Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916):
>
> information_source This topic covers how to configure some common S3 compatible Object Storage providers (S3 clones). See [Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229) for more details about Amazon AWS S3 configuration, which is officially supported and used internally by Discourse for our hosting services. Provider Service Name Works with Discourse? [Amazon AWS](#aws-s3-2) S3 Yes [Digital Ocean](#digital-ocean-spaces-3) Spaces Yes [Linode](#linode-object-storage-4) Object Storage Yes [Google Cloud](#google-cloud-platform-storage-5) Storage Yes [Scaleway](#scaleway-object-storage-6) Object Storage Yes [Vultr](#vultr-object-storage-7) Obj…

> [@Faizan\_Zahid](#):
>
> it is also a public server to host images. When i use remote images from 3rd party free image public CDNs then they are also accessible by anyone, same with S3. Then why does Discourse not allow / support the public images URLs to be used as topic thumnails?

Because Discourse does not have permission to access the S3 bucket and optimize the images for display on the site. Discourse also cannot guarentee that the link will always work - the person who owns the bucket could delete the file.

---

<div class="post-metadata">

### Author: ![Faizan\_Zahid](https://avatars.discourse-cdn.com/v4/letter/f/b9bd4f/32.png) [@Faizan\_Zahid](https://meta.discourse.org/u/Faizan_Zahid)
#### Post date: [26 באוקטובר,‏ 2020,‏ 11:51am UTC](https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257/5 "2020-10-26T11:51:44Z")

</div>

> [@david](#):
>
> Because Discourse does not have permission to access the S3 bucket and optimize the images for display on the site.

Do you mean my discourse doesn’t have permission to access S3 Bucket of other 3rd party free CDN images sites?  
If i can access an image in a browser, then discourse can too, and already discourse is optimising the images i share using hot-links. So i think we need this feature for sure.

i updated my reply above for discourse CDN comparison, please check.

What other cheapest way do you suggest me to host my images in bulk? Because i am afriad that if my site get millions of topics means billions of images, and my Discourse site backup will start getting bigger bigger and very hard and expensive to manage/scale and migrate. What would i do in that case then?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [26 באוקטובר,‏ 2020,‏ 11:53am UTC](https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257/6 "2020-10-26T11:53:11Z")

</div>

> [@Faizan\_Zahid](#):
>
> Do you mean my discourse doesn’t have permission to access S3 Bucket of other 3rd party free CDN images sites?

It does not have permission to manage and optimize those files.

If you really need this feature, the best option would be to post in the #Marketplace and find a plugin developer that can help you build the feature.

---

<div class="post-metadata">

### Author: ![Faizan\_Zahid](https://avatars.discourse-cdn.com/v4/letter/f/b9bd4f/32.png) [@Faizan\_Zahid](https://meta.discourse.org/u/Faizan_Zahid)
#### Post date: [26 באוקטובר,‏ 2020,‏ 11:59am UTC](https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257/7 "2020-10-26T11:59:29Z")

</div>

Thanks , i have opened a PAID topic for the same feature in core or via plugin,

> [@Paid: Overwrite meta og:image source to use externally public loaded hotlink CDN images on topics?](https://meta.discourse.org/t/paid-overwrite-meta-og-image-source-to-use-externally-public-loaded-hotlink-cdn-images-on-topics/168266):
>
> What would you like done? My this topic explains what i want: Basically, i don’t want to manage images on my own server or on S3, i want to fully rely on 100% free 3rd party free image hosting sites. And use their hotlinks, these hotlinks must be detected by Discourse core as my topic thumbnail, so that the topic hotlink image can be shown in social shares on social sites as well as in [Topic Preview Plugin](https://meta.discourse.org/t/topic-list-previews/101646/1342) Do i need a plugin or feature in discourse, i m not sure, please advise me? When do …

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [26 באוקטובר,‏ 2020,‏ 6:00pm UTC](https://meta.discourse.org/t/overwrite-meta-og-image-image-source-to-use-externally-public-loaded-images-on-topics/168257/8 "2020-10-26T18:00:00Z")

</div>

This topic was automatically closed after 5 hours. New replies are no longer allowed.
