A new theme can request image sizes that older uploads do not yet have. Regenerating the relevant thumbnails can create those variants without reuploading every original, provided the originals and media records remain available.
IN THIS ARTICLE
01 Prepare and limit the scope
Confirm the active theme and required image sizes first. Back up uploads and the database, check available storage, and identify a small group of affected images. Regeneration can consume processing resources, so avoid starting a large job during a busy period without planning.
Use a maintained supported plugin or WP-CLI where your service provides command-line access. Do not delete all existing thumbnail files manually before verifying the replacement process.
02 Test with WP-CLI where available
- Confirm the correct WordPress installation path and select the intended attachment IDs.
- Run a limited regeneration while preserving existing thumbnails, for example:
wp media regenerate 123 124 --skip-delete --path=/path/to/wordpress
- Review the command result and inspect the affected images in the actual theme.
- If only missing sizes are needed, review the documented
--only-missingoption before the wider job. - Expand the job in manageable batches and monitor failures and resource use.
03 Verify all delivery layers
Check featured images, galleries and responsive-image candidates, not only the original file. Purge relevant caches or CDN variants after confirming that the new files exist. A successful command cannot restore an original that was already deleted.
Preserving old thumbnails is useful when external pages link directly to them, but it can increase storage. Any later cleanup should be a separate reference-aware decision.
What if thumbnail regeneration fails partway through?
Record failed attachment IDs and their errors. Investigate missing originals, permissions, format support or processing limits before rerunning the entire library. A job interrupted halfway through may already have completed many images.
If the new crop is wrong, adjust the theme's intended size or crop rule before regenerating again. Repeated regeneration with the same configuration will not fix an unsuitable composition. Keep the backup until the representative layouts and generated file URLs have been verified.