Skip to content

WordPress Tip: Find and delete generated images

Writing  ✺  WordPress

When you are changing themes on a site or altering the image sizes used on a WordPress site, you’ll have to regenerate all the image sizes. Maybe you ran into the situation that you want to move the site and will have to generate new images again, after the move. For those that have SSH access to their site or local development environment, here are two simple tips I used for as long as I can remember them 😁.

Find & delete generated images

By default WordPress stores the generated image files in the following format:

// WordPress generated image file names
<your-image-file-name>-SIZExSIZE.jpg

// Example for a thumbnail image size
my-wonderful-image-of-a-cat-150x150.jpg

The files generated will be stored in the uploads folder, usually within the wp-content folder on your site. On Linux based server or macOS, you usually have access to the find command:

Regenerate WordPress image sizes

The second gist regenerates all the image sizes. Make sure you have the WordPress command line interface installed on your server. Otherwise you can use a plugin like Regenerate Thumbnails.

Find both commands in this Gist.

Comments

You might like

Code Snippet: Remove Jetpack Related Posts from Woo Testimonials

Installing the 108 most popular WordPress plugins at once