I have a new set of image sizes for my site's in-development theme. My server is filled with old image sizes, most of which have never been used. You've heard this one before, right?
The Question
How do I delete all WP generated thumbnails from my server but not those thumbnails currently used in posts?
That is to say something like: $ find . -name "*-*x*.jpg" | xargs rm -f
is too wide of a hammer because myimage-300x250.jpg
might be used in a post. Its 6 other variations are welcome to go away though!
I think I need to generate a list of used images, compare that to my directory and delete the difference (minus the originals). But how to go about that escapes me.
The "why?" sidebar:
Extra image sizes on the server is generally no big deal but we have over 2.7 gigs in their right now and it just seems a waste to leave them and back them up. Plus, we're about to start fresh - why not do the spring cleaning?
As far as regenerating the thumbs, while the new design has new image specifications, none of us have the time to go and update hundreds of older posts with RTE inserted images. Let bygones be bygones, I say.