# Broken image in Discourse (but they work in the message preview)

**URL:** https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429
**Category:** WordPress
**Created:** [6월 21, 2018, 10:39오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429 "2018-06-21T22:39:42Z")
**Posts on this page:** 19
**Page:** 1

<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: [6월 21, 2018, 10:39오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/1 "2018-06-21T22:39:42Z")

</div>

Hi,  
When I publish a WP post to Discourse, the images won’t show up:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/c/2cd4d254d18e9e84ca10290ad5d0f275f625a383.png)

But they do show up in the message preview if I edit the topic.

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

Saving the edit or rebuilding the message HTML don’t fix it.  
Typical HTML of such an image is:

```html
<img class="wp-image-157219 size-full aligncenter" src="http://monocycle.info/wp-content/uploads/2018/06/catégories-e1529598284988.png" alt="" width="400" height="364" />

```

Any idea?

edit: I may have understood why.  
The domain monocycle.info has been locally redirected to the server I’m working on, which is where my WordPress is installed. I did the redirection via the hosts windows file.  
But Discourse doesn’t have this redirection, so I guess it has to read these images URLs by itself before somewhat delivering them on the message, and so it can’t find these image?  
Not 100% sure this is the cause, but since my website will be launched in a few days, I’ll figure out when the domain will be globally redirected to my server.

---

<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: [6월 24, 2018, 10:36오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/2 "2018-06-24T10:36:06Z")

</div>

Hi,  
Unfortunately it was not the problem I guess.  
The DNS propagation is down, but the issue remains:

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

Even for images with the proper markdown syntax (see the very first image link):

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

The topic:

> **[Monocycle.info fait peau neuve](https://forum.monocycle.info/t/monocycle-info-fait-peau-neuve/22552)**
>
> Voir l’article sur le site : https://monocycle.info/monocycle-info-fait-peau-neuve/ Vous avez sans doute remarqué que votre site préféré (mais si, mais si) a fait un petit lifting. Oh, rien qui change trop profondément vos habitudes, puisque...

And the WP post: [monocycle.info fait peau neuve - Monocycle.info](https://monocycle.info/monocycle-info-fait-peau-neuve/)

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [6월 24, 2018, 10:46오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/3 "2018-06-24T10:46:21Z")

</div>

I can be wrong but what I understand here is that images may be loading on a secure site (https) but their links are (http) What I understand from that is the server from where the post is published should be configured to fully support https first.

EDIT: but that doesn’t looks like the case, I visited the site and both WP and Discourse are configured to load over SSL. What needs to be seen is how have you configured Discourse WP plugin.

---

<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: [6월 24, 2018, 10:57오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/4 "2018-06-24T10:57:18Z")

</div>

On the first message they were indeed in http, but I have updated my website shortly after, so as you can see on the second message, they are in https.

Here’s my [WP Discourse](https://github.com/discourse/wp-discourse) configuration:

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

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [6월 25, 2018, 8:08오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/5 "2018-06-25T20:08:18Z")

</div>

What happens if you try rebuilding the HTML now?

---

<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: [6월 25, 2018, 8:20오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/6 "2018-06-25T20:20:54Z")

</div>

Hi,  
It doesn’t do anything. 😕

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [6월 25, 2018, 8:21오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/7 "2018-06-25T20:21:44Z")

</div>

> [@Canapin](#):
>
> But Discourse doesn’t have this redirection, so I guess it has to read these images URLs by itself before somewhat delivering them on the message, and so it can’t find these image?

This does appear to have been the case - posting those URLs on that site in a new message works:

```plaintext
https://monocycle.info/wp-content/uploads/2018/06/new-site.png

```

⬇  
 ![image](https://global.discourse-cdn.com/meta/optimized/3X/9/6/9601e97ad6617c1f54b5d96c896243cbb068b8a7_2_690x84.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: [6월 25, 2018, 8:25오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/8 "2018-06-25T20:25:05Z")

</div>

Hmm, since I’m here, I’m a bit puzzled as the topic doesn’t appear in its own category:  
Here’s the topic: [Monocycle.info fait peau neuve - Actualités - Monocycle.info](https://forum.monocycle.info/t/monocycle-info-fait-peau-neuve/22552)  
Last activity June 19, but I can’t find it here: [Actualités - Monocycle.info](https://forum.monocycle.info/c/actualites)

🤔

> [@supermathie](#):
>
> This does appear to have been the case - posting those URLs on that site in a new message works:

Why doesn’t it work on this very topic then? Why doesn’t rebuilding the HTML work? 😕  
Maybe it’s a server-side cache issue?

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [6월 25, 2018, 8:34오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/9 "2018-06-25T20:34:32Z")

</div>

> [@Canapin](#):
>
> the topic doesn’t appear in its own category

I see it here:

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

> [@Canapin](#):
>
> How does it doesn’t work on this very topic then?

Strangely it works in a new post: [Monocycle.info fait peau neuve - numéro 19 - Actualités - Monocycle.info](https://forum.monocycle.info/t/monocycle-info-fait-peau-neuve/22552/19?u=supermathie) (feel free to delete that after you look)

> [@Canapin](#):
>
> Why rebuild the HTML doesn’t work?

It should have fixed this - please check the logs ([https://forum.monocycle.info/logs](https://forum.monocycle.info/logs)) which may show you more details on the error.

---

<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: [6월 25, 2018, 8:54오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/10 "2018-06-25T20:54:01Z")

</div>

Uh… I don’t have it on my list when I’m logged in:

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/1/812506a61e48cf945648e456a4a3addfc1c0d57f.png)  
But it appears when I’m logged out. Any idea why?

When I rebuild the HTML, all the pictures appear a split second before transforming into these broken image icons.

I have no output in the error log.

---

<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: [7월 13, 2018, 11:35오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/11 "2018-07-13T11:35:10Z")

</div>

Hi again. So, nobody has an idea of what’s happening here?

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [8월 16, 2018, 3:20오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/12 "2018-08-16T15:20:12Z")

</div>

11 posts were split to a new topic: [Image downloader should be more resilient and possibly slow down](https://meta.discourse.org/t/image-downloader-should-be-more-resilient-and-possibly-slow-down/94883)

---

<div class="post-metadata">

### Author: ![anon36484860](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon36484860](https://meta.discourse.org/u/anon36484860)
#### Post date: [1월 11, 2019, 5:47오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/22 "2019-01-11T05:47:14Z")

</div>

I have a similar issue. Images are just not displayed in the post in Discourse. Only the alt or title values are displayed

WP Post:

> **[Wieviel Ertrag Ist pro Pflanze möglich? - CannabisAnbauen.net](https://www.cannabisanbauen.net/wieviel-ertrag-pro-pflanze-moeglich/)**
>
> Wieviel Cannabis kann man ernten? Diese Frage stellen sich vor allem Erstgrower. Schließlich will keiner sich drei Monate lang um Pflanzen kümmern, nur um am Ende ein paar Gramm rauszuholen, die nach zwei Wochen weg sind. Die Trockenmasse zählt Der...

Discourse post:

> **[Wieviel Ertrag pro Pflanze möglich?](https://forum.cannabisanbauen.net/t/wieviel-ertrag-pro-pflanze-moeglich/4505)**
>
> Original Artikel: Wieviel Ertrag Ist pro Pflanze möglich? | CannabisAnbauen.net Wieviel Cannabis kann ich ernten? Diese Frage stellen sich vor allem Erstgrower. Schließlich will keiner sich drei Monate lang um Pflanzen kümmern, nur um am Ende...

---

<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: [1월 11, 2019, 5:56오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/23 "2019-01-11T05:56:14Z")

</div>

Are you sure the image links are https? This is important if the discourse you are posting on is https.

---

<div class="post-metadata">

### Author: ![copymonopoly](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@copymonopoly](https://meta.discourse.org/u/copymonopoly)
#### Post date: [1월 13, 2025, 7:00오후 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/24 "2025-01-13T19:00:23Z")

</div>

저도 같은 질문이 있습니다. Discourse에서는 이미지가 깨져 보이지만, 메시지 미리보기에서는 정상적으로 표시되고 클릭하면 올바르게 열립니다.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [1월 14, 2025, 8:04오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/25 "2025-01-14T08:04:13Z")

</div>

안녕하세요 @copymonopoly, [WP Discourse](https://github.com/discourse/wp-discourse) 플러그인으로 생성된 게시물에 있는 깨진 이미지인가요?

---

<div class="post-metadata">

### Author: ![copymonopoly](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@copymonopoly](https://meta.discourse.org/u/copymonopoly)
#### Post date: [1월 14, 2025, 8:45오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/26 "2025-01-14T08:45:50Z")

</div>

깨진 이미지는 원래 서버에 저장되어 있었습니다. `migrate_to_S3`를 사용하여 이 문제를 해결했지만, 새로운 문제가 발생했습니다.

> [@S3로 파일이 마이그레이션될 때 발생하는 버그](https://meta.discourse.org/t/a-bug-when-files-were-migrated-to-s3/346954):
>
> I encountered a problem that is the opposite of what is described in this content.In fact，all files, including images, have the Content-Disposition set to attachment, causing the files to be downloaded.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [1월 14, 2025, 8:51오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/27 "2025-01-14T08:51:59Z")

</div>

이 주제는 Wordpress 플러그인으로 생성된 게시물에서 이미지가 깨지는 문제에 대해 구체적으로 다루고 있습니다. 작성하신 다른 주제에서 답변을 해주세요.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [1월 14, 2025, 8:54오전 UTC](https://meta.discourse.org/t/broken-image-in-discourse-but-they-work-in-the-message-preview/90429/28 "2025-01-14T08:54:15Z")

</div>


