Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-17T11:03:54.100Z
Answers.Text: 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.
Answers.UserDisplayName: Álvaro Franz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-15T09:45:46.937Z
Answers.LastActivityDate: 2022-08-15T09:45:46.937Z
Answers.UserDisplayName: James Smith
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-17T11:05:14.413Z
Answers.LastActivityDate: 2022-08-17T11:05:14.413Z
Answers.UserDisplayName: Álvaro Franz
Body: <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>
  
Tags: <redactor><image-transforms>
Title: How to force a default transform on existing content within a Redactor field
ThreadText: # 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 username_1, 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](https://nystudio107.com/docs/image-optimize/) plugin.
  
  ```
  php craft image-optimize/optimize/create
  
  ```
  
  More console commands in the [official docs](https://nystudio107.com/docs/image-optimize/using.html#console-commands).
  
  
  ---
  
  