Title: S3 Image Optimizer
Author: nosilver4u
Published: <strong>June 17, 2021</strong>
Last modified: March 4, 2026

---

Search plugins

![](https://ps.w.org/s3-image-optimizer/assets/banner-772x250.jpg?rev=2816100)

![](https://ps.w.org/s3-image-optimizer/assets/icon-256x256.jpg?rev=2816100)

# S3 Image Optimizer

 By [nosilver4u](https://profiles.wordpress.org/nosilver4u/)

[Download](https://downloads.wordpress.org/plugin/s3-image-optimizer.3.0.0.zip)

 * [Details](https://pcd.wordpress.org/plugins/s3-image-optimizer/#description)
 * [Reviews](https://pcd.wordpress.org/plugins/s3-image-optimizer/#reviews)
 *  [Installation](https://pcd.wordpress.org/plugins/s3-image-optimizer/#installation)
 * [Development](https://pcd.wordpress.org/plugins/s3-image-optimizer/#developers)

 [Support](https://wordpress.org/support/plugin/s3-image-optimizer/)

## Description

The S3 Image Optimizer will optimize all your images in 1-1,000+ Amazon S3 buckets
using the EWWW Image Optimizer. Since EWWW IO integrates directly with plugins like
WP Offload Media, S3 IO is generally for folks who use a solution other than WP 
Offload Media to put their images on S3. But, if you have 20 sites sharing an S3
bucket, or have lots of buckets, and you would want to optimize them all from one
place instead of 20 different sites, this is the plugin for you.

S3 IO features a web-based bulk optimization process, and a WP-CLI interface for
massive buckets. S3 IO works with any S3-compatible storage service including Linode,
Backblaze B2 and Digital Ocean Spaces.

You may report security issues through our Patchstack Vulnerability Disclosure Program.
The Patchstack team helps validate, triage and handle any security vulnerabilities.
[Report a security vulnerability.](https://patchstack.com/database/vdp/s3-image-optimizer)

### Credits

Written by [Shane Bishop](https://ewww.io) with special thanks to my [Lord and Savior](https://www.iamsecond.com/).

## Installation

First, it is worth noting that S3 IO is “site agnostic”. For example, if you have
images for http://www.example.com in your S3 bucket, you do NOT have to run S3 IO
on the WordPress install for example.com. You could install it at test.com, or myfuzzybunnies.
com, or any site you manage. In fact, you may even create a dedicated WordPress 
install just for running S3 Image Optimizer, with no other plugins needed except
EWWW IO and S3 IO.

#### Setup

Now that we have that cleared up, let’s get down to business. You need 2 plugins
to make this work: S3 Image Optimizer, and the [EWWW Image Optimizer](https://wordpress.org/plugins/ewww-image-optimizer/).
Then…

 * Make sure you have configured EWWW IO with the settings you want to use.
 * [Setup your AWS access keys](https://docs.ewww.io/article/61-creating-an-amazon-web-services-aws-user),
   and then enter your access keys on the S3 IO settings page and save to confirm
   them.
 * Enter the buckets you wish to optimize in the appropriate text area. Leave it
   empty to have the plugin optimize all your buckets.
 * You may also define constants to restrict S3 IO to a specific bucket and/or sub-
   folder: S3_IMAGE_OPTIMIZER_BUCKET and S3_IMAGE_OPTIMIZER_FOLDER. These override
   the bucket list on the settings page, and will look like this (note the lack 
   of leading/trailing slashes on the folder setting):
 * define( ‘S3_IMAGE_OPTIMIZER_BUCKET’, ‘my-amazing-bucket-name’ );
    define( ‘S3_IMAGE_OPTIMIZER_FOLDER’,‘
   wp-content/uploads’ );
 * If your IAM user does not have access to list all buckets, you will generally
   also need to configure the region, something like this:
 * define( ‘S3_IMAGE_OPTIMIZER_REGION’, ‘eu-west-1’ );
 * If you are using an S3-compatible provider other than Amazon, you can define 
   the region and endpoint constants:
 * define(‘S3_IMAGE_OPTIMIZER_REGION’, ‘us-west-004’);
    define(‘S3_IMAGE_OPTIMIZER_ENDPOINT’,‘
   https://s3.us-west-004.backblazeb2.com’);
 * Likewise, you may need to force the usage of path-style endpoints with some providers:
 * define( ‘S3_IMAGE_OPTIMIZER_PATH_STYLE’, true );

[View the full list of region names.](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints)

#### Usage

 * Go to Media->S3 Bulk Optimizer to start optimizing your bucket(s).
 * Use Media->S3 URL Optimizer to optimize specific images by their url/address.
 * Use WP-CLI to optimize your buckets from the command line, especially useful 
   for large buckets or scheduling bulk optimization: `wp-cli help s3io optimize`

## FAQ

### What happens if I have so many images that the S3 Bulk Optimizer keeps timing out?

If you have configured S3 IO to optimize all your buckets, try a single bucket to
see if that will work. If that still doesn’t work, use the S3_IMAGE_OPTIMIZER_FOLDER
setting above to restrict optimization to a specific folder. This way you can optimize
a single bucket by configuring each folder within the bucket, running the S3 Bulk
Optimizer, and then moving to the next folder.

If the last option has you groaning, see if your web host supports WP-CLI. Using
WP-CLI allows you to avoid any timeouts, and solves a whole host of issues with 
long-running processes. The `wp-cli help s3io optimize` command should get you going.

If you’ve tried everything, and WP-CLI isn’t an option with your web host, find 
a web host that DOES support WP-CLI. It’s pretty easy to find a cheap host that 
supports WP-CLI, like GoDaddy. While I wouldn’t recommend GoDaddy for hosting, if
you want a cheap solution to run WP-CLI, it works. Remember that S3 IO is site agnostic,
so you can run it from a site completely separate from the site(s) that your S3 
images belong to. You could also fire up a Digital Ocean droplet with WordPress 
pre-installed for $5 and put WP-CLI on there. When you’re done, you can make a backup
image of the droplet and destroy it so that you aren’t paying for usage all the 
time.

### What about X, or Y, or maybe even Z?

Most problems we’ve seen are either permissions-related, or covered by the timeout
stuff above. If you have a question, [shoot us an email](https://ewww.io/contact-us/)!

## Reviews

![](https://secure.gravatar.com/avatar/54c56ef9c4f28bea85c7c868324842f2fb6c806d7d2ddcb82e1f18f5dd786b6d?
s=60&d=retro&r=g)

### 󠀁[Very good plugin](https://wordpress.org/support/topic/very-good-plugin-2441/)󠁿

 [ercogx](https://profiles.wordpress.org/ercogx/) April 28, 2022 1 reply

Thanks the plugin helped a lot. If I set a limit on the folder S3_IMAGE_OPTIMIZER_FOLDER
it would be cool to show it in the UI, because it is not clear whether it was applied
or not

 [ Read all 1 review ](https://wordpress.org/support/plugin/s3-image-optimizer/reviews/)

## Contributors & Developers

“S3 Image Optimizer” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ nosilver4u ](https://profiles.wordpress.org/nosilver4u/)

“S3 Image Optimizer” has been translated into 1 locale. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/s3-image-optimizer/contributors)
for their contributions.

[Translate “S3 Image Optimizer” into your language.](https://translate.wordpress.org/projects/wp-plugins/s3-image-optimizer)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/s3-image-optimizer/),
check out the [SVN repository](https://plugins.svn.wordpress.org/s3-image-optimizer/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/s3-image-optimizer/)
by [RSS](https://plugins.trac.wordpress.org/log/s3-image-optimizer/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 3.0.0

_Release Date – March 4, 2026_

 * added: support for optimizing WebP image uploads
 * added: support for WebP naming mode in EWWW Image Optimizer
 * added: utility for migrating between WebP naming modes
 * added: utility to remove all WebP image copies from S3
 * added: option to force re-optimization of previously optimized images
 * added: option to only generate WebP images
 * improve: optimize by URL handles path-style URLs and 404 errors better
 * changed: bulk optimizer results consolidated with image table for less memory
   usage and simpler navigation
 * changed: AWS exception handling catches more errors and is more readable
 * updated: AWS SDK to latest version
 * fixed: duplicate records created when size of object in bucket changes
 * fixed: uncaught PHP exception when checking ownership controls on older buckets
   where policy is not explicitly set
 * fixed: multiple strings missing i18n
 * fixed: undefined variables in exception handlers
 * fixed: some strings missing i18n
 * fixed: malformed AJAX responses not handled properly during bulk optimization
 * security: missing some capability checks

#### 2.6.1

_Release Date – August 15, 2024_

 * added: override auto-detected object ownership enforcement via S3IO_OBJECT_OWNERSHIP_ENFORCED
   constant or s3io_object_ownership_enforced filter: set either to true to disable
   per-object acls
 * fixed: optimize by URL incorrectly overwrites previous optimization results if
   multiple buckets have objects with identical paths

#### 2.6.0

_Release Date – August 1, 2024_

 * added: support for buckets with object ownership enforced
 * added: force usage of path-style endpoint with S3_IMAGE_OPTIMIZER_PATH_STYLE
 * changed: improved error handling for optimize by URL
 * changed: bumped minimum WP and PHP versions
 * fixed: malformed image size information in optimization table

#### 2.5.1

_Release Date – September 20, 2023_

 * changed: use updated WP coding standards
 * changed: cleanup AWS SDK folder

#### 2.5.0

_Release Date – June 22, 2023_

 * added: compatibility with EWWW Image Optimizer 7+ and better future-proofing 
   to detect compatibility errors
 * updated: AWS SDK to latest version
 * updated: improved PHP 8.2 compatibility, though there are still (non-critical)
   deprecation notices from the AWS SDK

#### 2.4.3

_Release Date – November 10, 2022_

 * changed: display the values of any constants defined for endpoint, region, or
   folder restriction
 * fixed: check if the bucket list is an array before sanitizing

#### 2.4.2

_Release Date – October 5, 2022_

 * added: define custom endpoint for any S3-compatible storage via S3_IMAGE_OPTIMIZER_ENDPOINT
 * fixed: cleanup of WebP copies using incorrect path

#### 2.4.1

_Release Date – June 21, 2022_

 * fixed: PHP notice when updating db records
 * removed EDD_SL_Updater file/class

#### 2.4.0

_Release Date – June 17, 2021_

 * fixed: failure in creating s3io/ working directory silently breaks bulk tools
 * fixed: sanitation for error messages was too aggressive
 * fixed: listBuckets error displayed even when S3_IMAGE_OPTIMIZER_BUCKET is defined

#### 2.3

_Release Date – November 24, 2020_

 * fixed: conflict getting local uploads directory when S3 Uploads plugin is active

#### 2.2

_Release Date – August 13, 2020_

 * added: generate and upload WebP version of your images in accordance with EWWW
   IO settings (WebP Conversion and Force WebP)
 * fixed bulk toggle-arrow styling
 * additional sanitizing and escaping for better security

#### 2.1

_Release Date – March 30, 2020_

 * updated AWS SDK to v3, let us know if you encounter errors
 * catch errors when defined region is incorrect
 * added ability to remove license key (e.g. if you entered it wrong)
 * rewrote bucket scanning to use AJAX in order to avoid timeouts
 * fixed delay not working for WP-CLI
 * display configuration errors when run from WP-CLI
 * fixed S3IO_DOSPACES constant not working
 * fixed scanner broken on objects with apostrophes
 * fixed URL optimizer with url-encoded characters (like spaces = %20)

#### 2.0

_Release Date – August 14, 2019_

 * added compatibility with Digital Ocean Spaces
 * lots of code cleanup and sanitation

#### Earlier versions

Please refer to the separate changelog.txt file.

## Community plugin

This plugin is developed and supported by a community. [Contribute to this plugin](https://github.com/nosilver4u/s3-image-optimizer)

## Meta

 *  Version **3.0.0**
 *  Last updated **1 month ago**
 *  Active installations **200+**
 *  WordPress version ** 6.6 or higher **
 *  Tested up to **6.9.4**
 *  PHP version ** 8.1 or higher **
 *  Languages
 * [English (US)](https://wordpress.org/plugins/s3-image-optimizer/) and [Russian](https://ru.wordpress.org/plugins/s3-image-optimizer/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/s3-image-optimizer)
 * Tags
 * [compression](https://pcd.wordpress.org/plugins/tags/compression/)[image](https://pcd.wordpress.org/plugins/tags/image/)
   [Optimize](https://pcd.wordpress.org/plugins/tags/optimize/)[s3](https://pcd.wordpress.org/plugins/tags/s3/)
   [wp-cli](https://pcd.wordpress.org/plugins/tags/wp-cli/)
 *  [Advanced View](https://pcd.wordpress.org/plugins/s3-image-optimizer/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/s3-image-optimizer/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/s3-image-optimizer/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/s3-image-optimizer/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/s3-image-optimizer/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/s3-image-optimizer/reviews/?filter=1)

[Add my review](https://wordpress.org/support/plugin/s3-image-optimizer/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/s3-image-optimizer/reviews/)

## Contributors

 *   [ nosilver4u ](https://profiles.wordpress.org/nosilver4u/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/s3-image-optimizer/)