Configure automatic image optimization

Image Optimizer has no quality, dimension, or format controls beyond its enablement switch. Its current processing policy is fixed by the module, so review that policy before using it on new uploads.

Requirements

  • The uploads directory and generated-size directories must be writable.
  • The server must provide Imagick or GD for image loading.
  • The production package must contain the image-processing dependencies.
  • External optimizer programs used by the image library must be available where required by the source format.
  • Back up the uploads directory and attachment metadata before first activation.

Enable the upload workflow

  1. Open Settings → POM Tweaks → Media → Media library.
  2. Enable Image optimizer.
  3. Save and reload the page.
  4. Upload one representative JPEG or PNG through Media → Add Media File.
  5. Open Media → Library in list view.
  6. Confirm Size Savings reports the original and optimized size.
  7. Check the full image and every size used by the active theme.

During upload, WordPress creates attachment metadata and the module then optimizes the source, creates applicable WebP companions, and removes obsolete generated variants for that attachment.

Filename collision behavior

WordPress normally allows example.jpg and example.png to share a base name. Image Optimizer avoids that ambiguity because their generated WebP companions would collide. If any supported image with the same base already exists in the current upload folder, the new file becomes example-1.ext, example-2.ext, and so on.

Generated-size changes

While enabled, the module prevents these WordPress sizes from being generated:

  • medium_large;
  • 1536x1536;
  • 2048x2048.

Other registered core, theme, and plugin sizes remain eligible. Test templates that explicitly request one of the removed sizes; WordPress may fall back to another available source, but the visual result belongs to the theme’s image markup.

Verify the off state

Disable Image optimizer, upload a new test image, and confirm no new optimization record or WebP companion is produced by this module. Previously optimized files remain unchanged.