Delete unused thumbnails and retina images

Hello,

I have a blog/site that is 10 years old and photo-heavy (more than 8,000 I believe). I also use a theme that creates lots of thumbnails. However, not all thumbnails are used to all pictures, far from it (most only need one or two thumbnails). Also, for a while, I had the "retina friendly" option of my theme checked.

I recently realized that I was running out of space on my server, and it was because of the sheer number of images generated for each picture uploaded, there are 14 thumbnails times two (so 28) because it also generated their retina counterparts, for each one of them.

I've been trying to find a way to clean that up a little bit, but all the plugins that I find looking on Google don't seem to do the trick (they see that all the thumbnails are registered so they leave them alone).

Is there a way to delete all images that are not actually used on the site (all the registered thumbnails that have been generated when the images were uploaded but that have never been used)? The only plugin I found that seemed to do it hasn't been updated in four years (and it's only partially automated), so I'm not too confident using it.

I'd also like to delete all the retina images (all ending with @2x.jpg). That only would save a lot of space on my server, even if I can't manage to delete the unused thumbnails.

Could anyone help?

Thanks in advance.

Disclaimer: my technical skills are basic. I can use Wordpress's backend fine, but I can't code much and while I understand database, I'm not sure how to handle them)

Posted Jun 1, 2020, 2:18 PM UTC

12
alesubliminal•

First of all, before doing anything, seriously, back your site up. Download all your files and database so you can revert any mistakes.

After that, you can use something like this: https://wordpress.org/plugins/media-cleaner/

And also this one, which can remove unused thumbnail sizes: https://wordpress.org/plugins/regenerate-thumbnails/

2
davidplusworldOPBlogger•

I know of these two plugins, I've been using regenerate thumbnails for a while.

I don't know if I'm using Media Cleaner wrong, but all it ever finds are pictures that are unused, not thumbnails of pictures.

And Regenerate is partly the source of my problem. I used it a few days ago, but had retina-mode on and it pretty much created retina-version of all my too many thumbnails.

And to my knowledge, it only deletes unregistered thumbnails.

What I want to be able to do is deleted the registered thumbnails that are unused. For example, my theme creates slider thumbnails for every single picture I upload, when I only have three pictures in my slider and I will never need the other 99.99% slider thumbnails.

Is there a plugin to do that?

1