[00] Subset Sizes, User guide
On-demand and lazy sizes
How missing sizes are created on first request, what each setting on Subset → Image Sizes does, and why you won't need a bulk regenerate.
This page explains how Subset Sizes creates sizes on demand, what each setting on Subset → Image Sizes changes, and how to handle size changes and cleanup without a bulk regenerate.
How on-demand sizes work
When a browser requests a size file that doesn’t exist, such as photo-600x400.jpg, the request falls through to WordPress. Subset Sizes then:
- Checks the size is one your site registered or asked for.
- Creates the file from the original upload and saves it in the uploads folder.
- Adds the size to the attachment’s metadata and sends the image to the browser.
From then on, your web server serves the file directly and WordPress isn’t involved. Creating a size takes a fraction of a second, once.
Sizes match what WordPress itself would make: the same dimensions and crops, EXIF rotation applied, PNG transparency kept. Images are never upscaled, and animated GIFs are left alone so they keep their animation. Responsive srcset attributes list every matching size, whether it exists on disk yet or not.
Lazy sizes
With Lazy sizes ticked, uploads create only the sizes ticked under Create at upload in the Registered sizes table. Every other size waits until a page uses it. Thumbnail and medium are ticked by default.
Tick a size under Create at upload when you want it ready the moment you upload, for example a size your newsletter or social cards use outside your own pages. Leave Lazy sizes off if you want WordPress’s usual behaviour. Missing sizes are still created on request either way.
Generation
The Generation setting decides when a missing size is made:
| Option | What happens |
|---|---|
| When the image file is first requested (recommended) | The page is sent with the size’s URL, and the size is made when the browser asks for that URL. |
| While the page that uses it is rendered | The size is made on the server while it builds the page, so the page links to a file that already exists. |
Resize in the background shows a larger existing size of the same shape while the new one is made by WP-Cron. WP-Cron only runs when someone visits, so on a quiet site those jobs can wait a long time. Leave it off unless page generation time matters more to you.
Change a size without a bulk regenerate
Change a size under Settings → Media, or switch to a theme with different sizes, and images already in your posts use the new dimensions. You don’t need to re-save posts or run a regenerate tool. Each new size is made the first time a page shows it.
If you’d rather create sizes ahead of time, run this from WP-CLI:
wp subset image-resizer generate
wp subset image-resizer generate --size=large,medium_large --ids=12,34
It creates missing sizes only and leaves existing files alone. With Pro, Pre-warm visits your pages in the background after a theme switch or size change and creates the sizes they show before visitors ask for them.
Delete sizes safely
A missing size is made again when it’s requested, so deleting size files never leaves a broken image. To remove files for sizes nothing registers any more, preview the list first, then run it for real:
wp subset image-resizer clean-orphans --dry-run
wp subset image-resizer clean-orphans
Originals, -scaled copies and image editor backups are never touched. To see your sizes, how many files exist and how much space they use, run wp subset image-resizer stats.
Pro’s Audit tab goes further. It records which sizes your pages load, lists the ones nobody has used for 30 days, and deletes their files while showing the space you get back. Sizes used in Elementor or Bricks content are never deleted.
Limits
The size handler is open to the internet, so it only creates:
- registered sizes, from your theme, plugins and Settings → Media
- sizes your own site has asked for in its code
Any other dimensions return 404 and write nothing. Two more limits apply, and you can change both on Subset → Image Sizes:
| Setting | Default | What it does |
|---|---|---|
| Maximum dimension | 4096 px | Requests for sizes wider or taller than this are refused. |
| Rate limit | 60 | New sizes one visitor can trigger per minute. Extra ones get a 429. |
Behind a CDN or proxy, every request can look like it comes from the same address, so all visitors share one rate limit. A developer can fix that with the subir_client_ip filter in the developer reference.
Optimisers and offload plugins
New sizes are handed to ShortPixel, Imagify and EWWW so they can compress them, 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. With other offload plugins, the original is downloaded from its URL. If a size can’t be made, visitors get the full image instead of a broken one. For product images, see WooCommerce.