# Is it possible to insert a code by default?

**URL:** https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682
**Category:** Support
**Created:** [March 1, 2022, 8:34am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682 "2022-03-01T08:34:25Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [March 1, 2022, 8:34am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/1 "2022-03-01T08:34:25Z")

</div>

It is possible, by default, to insert a code, before every link of .gif .mp4 .png .jpeg  
In this case this code here

`[img]http://[/img]`

I’m facing a problem on my site that doesn’t embed gif, mp4 and images, but if I put this embed code, then I thought, is it possible every time I post a link with the end of these extensions, this code is automatically added?

`[img]http://[/img]`

---

<div class="post-metadata">

### Author: ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)
#### Post date: [March 1, 2022, 8:41am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/3 "2022-03-01T08:41:42Z")

</div>

What code are you referring to here? Is your site a Discourse site?

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [March 1, 2022, 8:45am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/5 "2022-03-01T08:45:43Z")

</div>

My site is a discourse forum, this is the code:

`[img]http://[/img]`

---

<div class="post-metadata">

### Author: ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)
#### Post date: [March 1, 2022, 8:50am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/6 "2022-03-01T08:50:53Z")

</div>

> [@danielabc](#):
>
> It is possible, by default, to insert a code, before every link of .gif .mp4 .png .jpeg  
> In this case this code here

If I understand your question correctly, out of the box, it is not possible to add custom code automatically to one’s post.

> [@danielabc](#):
>
> I’m facing a problem on my site that doesn’t embed gif, mp4 and images

If this is the main issue you are facing that is making you want to add the code, then check out the `authorized extensions` site settings in your site: `yoursite.com/admin/site_settings/category/all_results?filter=authorized%20extensions`

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

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [March 1, 2022, 9:06am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/8 "2022-03-01T09:06:38Z")

</div>

But why can’t I add automatic code to the links? (And when I use the copy image, there is always an automatic code in the link, there is no way to do the same?) exemple:

[https://i.gyazo.com/1dafc9d66a55948f34902751709994b3.mp4](https://i.gyazo.com/1dafc9d66a55948f34902751709994b3.mp4)

```plaintext
![Moderador|120x120](upload://eqY4BNsVC9zAbuPy8ZJ4zCMBmHc.gif)

```

![5155](https://global.discourse-cdn.com/meta/optimized/3X/0/c/0c1b28585aa3573dedfacaffd901dadcaecb0a82_2_345x25.png)

I commented on it here

> [@Is it possible to paste images as their source address?](https://meta.discourse.org/t/is-it-possible-to-paste-images-as-their-source-address/218554):
>
> When I right-click on an image and go to “copy image” and paste it somewhere, a formatting like How do I make it paste only the image link and not this formatting? I know that if I right-click and click “Copy link address” or “Copy image address” only the image link will be pasted, but I want this to be possible in “Copy image” I want to remove this automatic formatting I want only the link to appear

There was a moderator who opened a topic, but they still haven’t responded

> [@Allow pasting of GIFs into composer](https://meta.discourse.org/t/allow-pasting-of-gifs-into-composer/218720):
>
> Continuing the discussion from [Is it possible to paste images as their source address?](https://meta.discourse.org/t/is-it-possible-to-paste-images-as-their-source-address/218554): If you right click and select “Copy Image” on a GIF you found on the internet with your browser, your clipboard will be populated with two elements: A static PNG image of the GIF as image/png An HTML img tag with the GIF source as text/html For most use cases, it’s a far better user experience to pick the option 1 in the clipboard and upload that image right away in the composer, so that is what we alwa…

I already tried this option that you gave me, it didn’t work, I’m having a serious problem in my forum of embedding gifs, I even commented here

> [@Imgur GIF link is no longer embedding](https://meta.discourse.org/t/imgur-gif-link-is-no-longer-embedding/218132/8):
>
> please if you find any solution let me know, my forum members are driving me crazy, and i don’t know what to do! How do I not update the discourse automatically? [image]

The only solution I think is if the code that I said in each link is automatically added .gif .mp4 .png .jpeg, because with these codes the extensions are incorporated or is there any way to reset all the discouse configuration? or do a new reinstallation, without affecting the users or the content of the forum?

or is there another solution?

I already talked with IMGUR, and with my server they said that everything is ok with them, that the error may be another

---

<div class="post-metadata">

### Author: ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)
#### Post date: [March 1, 2022, 9:12am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/9 "2022-03-01T09:12:17Z")

</div>

Oh! I see! Thank you for sharing those links, I now fully understand what your request is.

We haven’t built or added that feature yet, as we don’t have the engineering time for it at the moment. But if you can make a PR for it or anyone else can, we’d appreciate that. We have a topic that explains the feature which you linked to: [Allow pasting of GIFs into composer - feature - Discourse Meta](https://meta.discourse.org/t/allow-pasting-of-gifs-into-composer/218720).

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [March 2, 2022, 10:19am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/10 "2022-03-02T10:19:20Z")

</div>

What is PR?

Too bad I don’t have this feature ☹ Do you know how I can reset all my forum settings (Discourse) without deleting members or forum content?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [March 2, 2022, 10:38am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/11 "2022-03-02T10:38:58Z")

</div>

Any admin settings that have been changed show up highlighted in yellow, and you can reset them using the ‘reset’ button for each. There’s also an ‘Only show overridden’ checkbox on the top right too, to only display those that have been changed (if you’re using mobile you may need to flip your phone to landscape view for that to show up 👍)

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [March 2, 2022, 11:11am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/12 "2022-03-02T11:11:06Z")

</div>

But is there an option that resets everything?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [March 2, 2022, 11:49am UTC](https://meta.discourse.org/t/is-it-possible-to-insert-a-code-by-default/219682/13 "2022-03-02T11:49:53Z")

</div>

Not that I’m aware of? Though I find using the method above really quick when I’m reconfiguring and reseting my test site for different problems.
