Skip to content

[00] Subset Sizes, User guide

Getting started

Install Subset Sizes, turn on lazy sizes, and check that missing image sizes are created when a page asks for them.

Subset Sizes creates image sizes when a page first asks for them, instead of making every registered size for every upload. This page covers installing it, choosing which sizes to keep at upload, and checking that it works on your server.

Before you start

You need:

  • WordPress 6.5 or later and PHP 8.1 or later.
  • Pretty permalinks. Any structure under Settings → Permalinks except Plain works.
  • On nginx, one extra server rule. See Set up nginx below.

Install

  1. Download the free Subset Sizes zip from subsetwp.com/download/sizes.
  2. In wp-admin, go to Plugins → Add New → Upload Plugin.
  3. Choose the zip, click Install Now, then Activate Plugin.

The free plugin needs no licence key and no account. Once it’s active, any missing size file is created the first time a browser requests it. Existing size files and metadata stay as they are.

Choose which sizes to create at upload

On a new install, lazy sizes is already on, so uploads create only thumbnail and medium. A site that updated from an earlier version keeps the setting it had. To check it, or to change which sizes are made at upload:

  1. Go to Subset → Image Sizes.
  2. Tick Lazy sizes.
  3. In the Registered sizes table, tick Create at upload for the sizes you want made straight away. Thumbnail and medium are ticked by default.
  4. Click Save Changes.

New uploads now get only the ticked sizes. Every other size is made the first time a page uses it.

The Registered sizes table lists every size on your site with its dimensions, crop and the theme or plugin that registered it. It’s a good way to see how many sizes each upload was costing you. For more on what each setting does, read On-demand and lazy sizes.

Set up nginx

Apache hosts with pretty permalinks need nothing else. nginx usually serves /wp-content/uploads/ itself and returns its own 404 for missing files, so the request never reaches WordPress. Add this block to your server config, above any other image location:

location ~* ^/wp-content/uploads/.+-[0-9]+x[0-9]+\.(jpe?g|png|gif|webp|avif)$ {
    try_files $uri /index.php?$args;
    expires max;
}

If you’re on managed hosting and can’t edit the config, send that block to your host’s support. Rules for plain permalinks, multisite and older networks are in the developer reference.

Check that it works

  1. Upload a test image, then open its file URL in a new tab.
  2. Edit the URL to ask for a registered size that wasn’t made at upload, for example change photo.jpg to photo-1024x683.jpg to match your large size.
  3. The image should load. Reload the page and your web server now serves the saved file directly.

If you get a 404, the request isn’t reaching WordPress. Check your nginx rule, or look for an .htaccess file inside wp-content/uploads/ that a security plugin may have added. Only registered sizes are created, so a made-up size like photo-123x45.jpg returns 404 on purpose.

Add Pro

Pro is a separate add-on plugin that needs the free one active. It adds AVIF and WebP copies, focal points, placeholders, watermarks, pre-warming, a size usage audit and more.

  1. Download the Subset Sizes Pro zip.
  2. Upload and activate it from Plugins → Add New → Upload Plugin, as above.
  3. Go to Subset → Image Sizes → License, paste your licence key and activate it.

Pro’s settings appear as new tabs on the same screen: Formats, Placeholders, Watermark and Audit. An active licence gets updates and support. For more on keys, read Activating a licence.

Get help

Report bugs and ask for features on the Subset feedback tracker (opens in a new tab). For anything else, email hello@subsetwp.com.