4

I have a WordPress site which used to weight around 350 MBytes. Then I changed the theme and found that I have to regenerate the thumbnails. So I did it, Twice actually, but Now the problem is that the size of my site has gone near 1.6GB, which is insane. I have only 2GB of Web Space and can't upgrade currently. Is there any way that I can delete all regenerated thumbnails from my uploads folder and then again regenerate them only once? I changed the theme a couple of times in the past and those thumbnails are all siting in the uploads folder, doing nothing.

3

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.