Skip to content

[01], plugin 10: Subset Sizes

WordPress makes every image size for every upload

Image sizes made on demand, so uploads stay fast.

Every theme and plugin adds its own image sizes, and WordPress makes all of them for every upload. Subset Sizes makes each size only when a page first asks for it, so uploads are faster and your uploads folder stays lean.

To install and update the free plugins from wp-admin, add the Subset Installer.

DocumentationChangelogUnder the hoodCompare with Regenerate ThumbnailsCompare with Disable Media Sizes

Requires
WP 6.5+ · PHP 8.1+
Tested to
WP 7.1
WP-CLI
Yes
Multisite
Yes
Editions
Free + Pro

How Subset Sizes works

WordPress makes every registered image size the moment you upload a photo, and every theme and plugin can register more. Subset Sizes moves that work to the first time a page asks for a size. A request for a missing size file falls through to WordPress, which makes the file from the original, saves it in your uploads folder and sends it to the browser.

From then on, your web server serves that file directly and WordPress isn't involved. Making a size takes a fraction of a second, once. Turn on lazy sizes and an upload creates only the sizes you tick, with thumbnail and medium ticked by default.

Because sizes are made when they're asked for, changing a size under Settings → Media doesn't need a bulk regenerate. Old posts pick up the new dimensions the next time they're shown, and a deleted size file comes back the next time it's requested.

The size handler is open to the internet, so it only makes sizes your site registered or asked for in its own code. Other dimensions return a 404 and write nothing. Sizes are capped at 4096 pixels by default, and one visitor can trigger 60 new sizes a minute.

How Subset Sizes works, for developers

What each version includes

Pro is a separate add-on that installs alongside the free plugin. Everything in the free list stays free.

Free

Full plugin

No time limit and no upgrade nags.

  1. Image sizes created on first request
  2. Lazy sizes: choose which sizes to make at upload
  3. Deleted size files come back when needed
  4. Srcset filled in with sizes that don't exist yet
  5. Limits on size, dimensions and requests per visitor
  6. WP-CLI: generate sizes, clean up orphans, see stats

Pro

Add-on

Everything in Free, plus:

  1. AVIF and WebP copies, served with picture tags
  2. Per-size quality and sharpening
  3. Blurred or dominant-colour placeholders
  4. Focal point picker for better crops
  5. Watermarks per image size
  6. Pre-warm sizes after a theme or size change
  7. Audit unused sizes and reclaim disk space
  8. Elementor, Bricks and WooCommerce size support

How it compares

Each comparison checks Subset Sizes against another plugin row by row, with a source for every claim about the other plugin. See every comparison

  • Pick Subset Sizes if you want uploads to make only the sizes you use, and old posts to pick up a changed size without a regenerate run. Pick Regenerate Thumbnails if you'd rather keep WordPress making every size at upload and rebuild them from a screen in wp-admin when a size or theme changes. It needs no server rule and runs on much older versions of PHP.

  • Pick Subset Sizes if you want to skip sizes at upload and still have each one made the first time a page needs it, including the sizes your theme and plugins register. Pick Disable Media Sizes if you only want WordPress to stop making some of its own default sizes, including the big scaled copy, with no server setup and nothing made later.

Questions

Does it work on nginx?
Yes, with one extra rule. nginx usually answers requests for missing upload files itself, so they never reach WordPress. Add the try_files rule from the getting started guide to your server config, or send it to your host's support if you can't edit it.
What happens to the image sizes I already have?
Nothing. Existing size files and their metadata stay as they are, and only missing sizes are made.
Can someone fill my disk by requesting random sizes?
No. Only sizes your site registered, or asked for in its own code, are made. Other dimensions return a 404 and write nothing. A maximum dimension (4096 pixels by default) and a limit of 60 new sizes per visitor per minute also apply, and you can change both.
Do I still need to run a bulk regenerate?
No. When you change a size or switch themes, each new size is made the first time a page shows it. If you'd rather make sizes ahead of time, wp subset image-resizer generate creates missing sizes and leaves existing files alone.
Does it work with image optimisation and offload plugins?
Yes. New sizes are handed to ShortPixel, Imagify and EWWW to compress, the same as sizes made at upload. With WP Offload Media, the original is copied back from your bucket to make the size, and the new file is uploaded again. If a size can't be made, visitors get the full image instead of a broken one.
Does the free plugin make WebP or AVIF files?
No. The free plugin makes sizes in the same format as the original upload, or the format WordPress's image_editor_output_format filter asks for. AVIF and WebP copies, served in picture tags, are part of Pro.
What does uninstalling remove?
All of its settings and internal data. The size files it made stay, because they're ordinary WordPress image sizes.
How much disk space do lazy sizes save?
With lazy sizes on, an upload makes only the thumbnail and medium sizes. Every other size is made the first time a page asks for it, so you save the space of each size your pages never use. On a site with six registered sizes, a 4000 × 3000 photo made 2 resized files instead of 6.

Underneath

Every Subset plugin has WP-CLI commands and documented hooks and filters.

Read the developer reference

Every Subset Sizes WP-CLI command

WP-CLI
$ wp subset image-resizer generate --size=large,medium_large --ids=12,34
$ wp subset image-resizer clean-orphans --dry-run
$ wp subset image-resizer stats

Hear about Subset Sizes releases

We’ll email you when Subset Sizes has a new release, and only about Subset Sizes.

One confirmation email, then nothing until we have news. Unsubscribing takes one click and no account.

We will email you a confirmation link. Click it and you are on the list. Until then nothing is confirmed.