How to Delete All regenerated thumbnails but keep the original ones?

If you use WP-CLI then that will automatically delete those sizes that you don’t need.

You would run the following command on your server via SSH. You will need to have WP-CLI installed on the server.

wp media regenerate --only-missing

You could also use find . -name "*-*x*.*" | xargs rm -f to delete all of the thumbnails from your uploads folder. Make sure that any files that you want to keep have the same pattern. Make sure you have backups of the images. props: https://deluxeblogtips.com/remove-image-sizes/

Otherwise there are a plugin that do this for you too.

https://wordpress.org/plugins/thumbnail-cleaner/

Leave a Comment