Regenerate WordPress featured images after changing the theme

After changing the standard image sizes in the media settings or switching to a new theme with different image sizes, the featured images for older posts must be regenerated. This post shows you which plugins can easily do this.

Why you have to regenerate WordPress post images

In the previous posts in my article series on featured images, we learned that different sizes are defined for images in WordPress. WordPress then creates several images in various image formats and sizes in the media library for each uploaded image.

This process always takes place when an image is uploaded. However, if the image sizes change due to a change in the WordPress theme, no images in the correct sizes for the new theme are available for older posts and their images.

As a result, existing images in the new theme are usually not displayed in the correct size as desired. For this reason, existing images in the media library have to be regenerated for the new sizes.

The Regenerate Thumbnails Plugin

The top dog for this task is Regenerate Thumbnails . The plugin is probably already known to some of you. Over a million active installations show the need to frequently regenerate images in WordPress.

Regenerate the thumbnails for one or more of your image uploads. Useful when changing their sizes or your theme.

By: Alex Mills (Viper007Bond)

( 357 )
Last updated: 3 months ago
1+ million active installs
Compatible up to: 5.4.4

After installing the plug-in, the process for regenerating all images can be initiated under Tools → Regenerate preview images. The plugin shows the overall progress in a stylish percentage bar and each generated image in a list with time information below.

Regenerate thumbnails

In order to only regenerate certain images, these can also be selected individually in the media library.

Generate thumbnails media library

In the case of many images or heavily frequented websites, the images can also be regenerated on a local WordPress installation or test server and then uploaded to the live server via FTP.

Force Regenerate Thumbnails

An alternative option is the Force Regenerate Thumbnails plugin.

Delete and ACTUALLY recreate thumbnails.

From: Pedro Elsner

( 161 )
Last updated: 4 years ago
500,000+ active installations
Compatible up to: 4.0.32

Basically, both plugins work exactly the same. The big difference, however, is that Force Regenerate Thumbnails deletes images that are no longer needed. This means that all images are removed for which an image size is no longer defined.

This has advantages and disadvantages. After changing the theme, the media library is cleaned up, images that are no longer used are deleted and storage space is gained. Deleting old images can also be a disadvantage.

Deletion is not a problem for featured images. Normal images in the content are saved and displayed with a hard-coded URL (e.g. image-300 × 200.jpg). If the image size is no longer defined and the plugin deletes all images with the size 300 × 200, these images are missing in your posts and pages.

The Force Regenerate Thumbnails Plugin should therefore not be used if the image sizes have been changed under Settings → Media . You have probably used these sizes very often for images in your content. WordPress cannot automatically change the URLs of embedded images, so the old image sizes are still referred to. But these images no longer exist.

If only the sizes of the featured images have changed, the plug-in is recommended to get rid of old images. Especially when the previous theme defined a lot of image sizes. In general, I always recommend making a backup before using the plugin.

Overview of all articles in this series