# Turn off image links validation?

**URL:** https://meta.discourse.org/t/turn-off-image-links-validation/285605
**Category:** Support
**Created:** [November 15, 2023, 6:18pm UTC](https://meta.discourse.org/t/turn-off-image-links-validation/285605 "2023-11-15T18:18:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![avaldez](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@avaldez](https://meta.discourse.org/u/avaldez)
#### Post date: [November 15, 2023, 6:18pm UTC](https://meta.discourse.org/t/turn-off-image-links-validation/285605/1 "2023-11-15T18:18:55Z")

</div>

Hi guys, I’m having issues with the cooked content of posts with images.

The thing is that we are using a custom link for images looking like:  
`/api/v1/discourse/custom/link/hash_id/filename.png`

Everything good when the post is created, but there’s a point while discourse is cooking that post html, that detects that this link is “broken”, so it replaces it’s content with a `<span>` like the following:

```plaintext
<span class="broken-image" title="This image is broken">
<svg class="fa d-icon d-icon-unlink svg-icon" aria-hidden="true"><use xlink:href="#unlink"></use></svg>
</span>

```

This is not happening on file uploads, so I’m wondering if there’s a way to disable this validation to keep cooked version intact?

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [November 15, 2023, 6:26pm UTC](https://meta.discourse.org/t/turn-off-image-links-validation/285605/2 "2023-11-15T18:26:17Z")

</div>

Have you enabled the `block hotlinked media` setting?

---

<div class="post-metadata">

### Author: ![avaldez](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@avaldez](https://meta.discourse.org/u/avaldez)
#### Post date: [November 15, 2023, 6:28pm UTC](https://meta.discourse.org/t/turn-off-image-links-validation/285605/3 "2023-11-15T18:28:24Z")

</div>

> [@Arkshine](#):
>
> hotlinked

I don’t, and I can’t find that setting in the UI, is there a special place to look for it?

Looking on this [thread](https://meta.discourse.org/t/2-9-0-beta5-security-fixes-block-hotlinked-media-pm-tagging-search-improvements-and-more/229845) I see there’s a `block_hotlinked_media` feature but I don’t really have that set.

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

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [November 15, 2023, 6:39pm UTC](https://meta.discourse.org/t/turn-off-image-links-validation/285605/4 "2023-11-15T18:39:11Z")

</div>

Can you share your Discourse version exactly?

It’s unlikely – is there a chance your image domain prevents hotlinked images?

---

<div class="post-metadata">

### Author: ![avaldez](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@avaldez](https://meta.discourse.org/u/avaldez)
#### Post date: [November 15, 2023, 6:59pm UTC](https://meta.discourse.org/t/turn-off-image-links-validation/285605/5 "2023-11-15T18:59:51Z")

</div>

Sounds like it, I’m aware we are using an old version **2.4.0.beta6** , we have plans to upgrade, but not just yet.

These image tags look like:

```plaintext
<img src="/api/v1/discourse/custom/link/hash_id/filename.png" width="452" height="409">

```

---

<div class="post-metadata">

### Author: ![avaldez](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@avaldez](https://meta.discourse.org/u/avaldez)
#### Post date: [November 16, 2023, 1:56pm UTC](https://meta.discourse.org/t/turn-off-image-links-validation/285605/6 "2023-11-16T13:56:26Z")

</div>

The solution to this issue was to include the hostname for the image, to have the full link. That way, even if discourse doesn’t have access to the resourse, it is not messing with `img` elements in the cooked version.

@Arkshine I appreciate your help.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [December 16, 2023, 1:56pm UTC](https://meta.discourse.org/t/turn-off-image-links-validation/285605/7 "2023-12-16T13:56:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
