Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio
Wordpress

WordPress: Fix Media Thumbnails Regenerating at the Wrong Size

- 24.11.26 - ErcanOPAK

📝 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.

— WordPress Admin

Related posts:

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

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 ...

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

WordPress: Fix Every Post Returning a 404 After Changing the Permalink Structure Because the Rewrite...

WordPress: Fix Every Post Returning a 404 After Changing the Permalink Structure Because the Rewrite...

Views: 9
Found this useful? Share it
XLinkedInWhatsApp

Post navigation

C#: Fix a Required Member Compiling Without a Setter Call
Ajax: Fix a Retry Wrapper Duplicating a Non-Idempotent POST

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Read

  1. 01How to make theater mode the default for Youtube 1,079 views
  2. 02How to add default value for Entity Framework migrations for DateTime and Bool 997 views
  3. 03Get the User Name and Domain Name from an Email Address in SQL 996 views
  4. 04Get the First and Last Word from a String or Sentence in SQL 873 views
  5. 05How to select distinct rows in a datatable in C# 868 views
  6. 06How to enable, disable and check if Service Broker is enabled on a database in SQL Server 671 views
  7. 07Add Constraint to SQL Table to ensure email contains @ 629 views
  8. 08Average of all values in a column that are not zero in SQL 584 views
  9. 09How to use Map Mode for Vertical Scroll Mode in Visual Studio 561 views
Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
Back to top
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com