📝 WordPress: Fix Media Thumbnails Regenerating at the Wrong Size
WordPress generates its fixed set of image sizes at upload time using whatever dimensions are registered for each named size at that exact moment, via core settings and any theme or plugin add_image_size calls. A theme switch, a plugin deactivation, or a page-builder update between the original upload and a later Regenerate Thumbnails run can leave a size registered under the same familiar name but with different pixel dimensions, so regeneration overwrites the existing, correctly-cropped thumbnail file with one cropped to the new dimensions, even though nothing about the original image or its intended display size ever actually changed.
🔎 The Problem
A product image’s “medium” thumbnail was generated at 400×400 by the old theme. After switching themes, add_image_size registers “medium” at 300×200, and running a bulk Regenerate Thumbnails silently replaces every existing 400×400 medium thumbnail across the whole media library with a 300×200 crop, including ones embedded in already-published posts that expected the old dimensions.
✅ Fix: Check Registered Sizes Before Any Bulk Regenerate
- Before running any bulk regenerate operation, check Settings > Media and every custom add_image_size call the active theme and plugins register, confirming the pixel dimensions match what you actually expect for each named size.
- Regenerate thumbnails only for images uploaded after a theme or image-size change, using a plugin that filters by upload date, instead of a blanket regenerate-all across the entire media library.
- Keep the original full-size upload for every image rather than deleting it after generating thumbnails, since any size can be regenerated correctly from the original but never recovered from an already-downscaled thumbnail.
🚨 Why This Is Dangerous
- A bulk regenerate run on a large media library can silently reflow image dimensions across hundreds of already-published posts, breaking layouts that depended on an exact old thumbnail size with no single visible error pointing at the cause.
A thumbnail’s name like ‘medium’ is just a label — its actual pixel dimensions are whatever happens to be registered the moment you regenerate, not the moment you uploaded.
Related posts:

WordPress: Fix Post Revisions That Silently Pile Up and Bloat Your Database Because WP_POST_REVISION...

WordPress: Fix a Custom Post Type's Entries Disappearing From the Site After a Theme Switch Because ...




