<p>You'll need the Retcon plugin to do this. <a href="https://plugins.craftcms.com/retcon" rel="nofollow noreferrer">https://plugins.craftcms.com/retcon</a></p>

CC BY-SA 4.0
2022-08-17T11:03:54.100Z
Hi James, thanks. I've looked into the plugin but with this one I'd have to explicit it in my twig templates. I want the transforms to be done on the server before it even processes the twig template.
Álvaro Franz
CC BY-SA 4.0
2022-08-15T09:45:46.937Z
2022-08-15T09:45:46.937Z
James Smith
<p>And the answer is: use the <a href="https://nystudio107.com/docs/image-optimize/" rel="nofollow noreferrer">Image Optimize</a> plugin.</p>
<pre><code>php craft image-optimize/optimize/create
</code></pre>
<p>More console commands in the <a href="https://nystudio107.com/docs/image-optimize/using.html#console-commands" rel="nofollow noreferrer">official docs</a>.</p>

CC BY-SA 4.0
2022-08-17T11:05:14.413Z
2022-08-17T11:05:14.413Z
Álvaro Franz
<p>There isn't much documentation out there about how to apply <a href="https://craftcms.com/docs/4.x/image-transforms.html" rel="nofollow noreferrer">image transforms</a> to images in a Redactor field.</p>
<p><strong>I found this</strong>: <a href="https://craftcms.stackexchange.com/questions/8271/apply-transform-to-image-uploaded-into-redactor">Apply transform to image uploaded into Redactor?</a></p>
<p>And it's useful, since I can even select a default transform:</p>
<p><a href="https://i.sstatic.net/p5kvr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/p5kvr.png" alt="enter image description here" /></a></p>
<p>... but I would like to go a bit further, and not only apply transforms to new content, but also to all the entries witin a specific section that uses a Redactor field.</p>
<p>Is that possible?</p>

<redactor><image-transforms>
How to force a default transform on existing content within a Redactor field
# How to force a default transform on existing content within a Redactor field

(Asked by: username_0 on 2022-08-08)

There isn't much documentation out there about how to apply [image transforms](https://craftcms.com/docs/4.x/image-transforms.html) to images in a Redactor field.

**I found this**: [Apply transform to image uploaded into Redactor?](https://craftcms.stackexchange.com/questions/8271/apply-transform-to-image-uploaded-into-redactor)

And it's useful, since I can even select a default transform:

[![enter image description here](https://i.sstatic.net/p5kvr.png)](https://i.sstatic.net/p5kvr.png)

... but I would like to go a bit further, and not only apply transforms to new content, but also to all the entries witin a specific section that uses a Redactor field.

Is that possible?

**Tags:** redactor, image-transforms


---

## 2 answers

### Answer by username_1 on 2022-08-15. Score: 2

You'll need the Retcon plugin to do this. <https://plugins.craftcms.com/retcon>

> **Comments:**
> **username_0**: Hi James, thanks. I've looked into the plugin but with this one I'd have to explicit it in my twig templates. I want the transforms to be done on the server before it even processes the twig template.  

---

### Answer by username_0 on 2022-08-17. Score: 1

And the answer is: use the Image Optimize plugin.
php craft image-optimize/optimize/create

More console commands in the official docs.


---

