SEOLivly
Menu
Home Tools Blog Services Contact Run the free scan

How to Find Unused WordPress Image Sizes Without Breaking Thumbnails

By Derek Murphy  · 

Search the uploads folder for a familiar image and you might find a whole family: desk.jpg, desk-150x150.jpg, desk-300x200.jpg, and six more. Some of those files serve your cards and mobile layouts. Others can belong to a theme you stopped using years ago. The useful part of an image-size audit is learning which is which.

Check the size policy and the files separately

In WordPress, a size can be registered by core, the theme, or a plugin. For a site you administer with WP-CLI, wp media image-size shows the sizes WordPress knows about now. If the active stack lists six sizes and old attachments have twelve, you have a reason to inspect the old files. That difference alone proves very little about individual URLs.

For each sampled attachment, compare the registered sizes with its attachment metadata, the files in its upload directory, and the URLs actually used in templates and content. Core can use the metadata to construct srcset, which is the browser’s list of alternative image files. A crop never mentioned by the visible src attribute can still be the one a phone downloads. WordPress responsive images handbook

Look beyond the post body

  • Rendered pages. Inspect src, srcset, picture sources, and lazy-load fields. Include a homepage card, an archive, a post with a gallery, and a product or service page.
  • Stored content. Page builders, reusable blocks, custom fields, widgets, and options may retain a filename or use an attachment ID that resolves to it.
  • CSS and third-party copies. Background images, offloaded media, emails, and external sites may use the old URL. Treat those unknown references as an explicit decision when protecting older public images.

Take desk-300x200.jpg as an example. If it appears in mobile srcset, keep it or change the responsive policy and verify the replacement first. If it appears nowhere on your samples and is absent from attachment metadata, it is a candidate for deeper reference checking. Save the path, size, and reason so you can review a batch without guessing from filenames alone.

Stop the next upload from creating the same mess

After mapping images to the layout, cut redundant future sizes in the theme or plugin that registers them. Upload one test image on staging and see what the site generates. Open it in a card and a gallery, then inspect the chosen image in a narrow viewport. A 150-pixel square crop and a 300-pixel landscape have different jobs even if both sound like “thumbnails.”

For old files, move a small batch to a recoverable location outside the public uploads folder after checking references. Keep its mapping to the old location. If you deliberately change sizes or regenerate thumbnails, remember that WordPress’s underlying metadata generator does not remove previously generated files for the attachment. WordPress attachment metadata reference

Run the same spot check when you're done

Reload the sample templates at phone and desktop widths. Open the actual requested image URLs, including the largest hero and the small archive cards. Record before and after counts. If you’re fighting a hosting quota, this belongs in the inode cleanup. If the images load and still feel huge, move on to WebP and responsive sizing. The WordPress maintenance checklist has the rest of the cleanup sequence.

Check your own page

The free website auditor runs forty checks on one URL and lists the worst problems first. No signup. If you would rather hand the list to somebody, the fix service has the prices on the page.

Run the free scan

Keep reading