Page 1 of 1

Delete Unused Images

Posted: Sun Sep 29, 2024 8:24 pm
by GetSirius
Does anyone know of an addon or script that would help find unused images? I imported everything from a 2.3xx site and would like to clean out the images directory. Searched and did not find anything here or in addons.

Re: Delete Unused Images

Posted: Mon Sep 30, 2024 6:35 am
by Kofod95
I think a made a quick "use and delete" thing a while back. I think I did delete i though... If not, I'll post it here.
It's a question of looking at which files in the images directory isn't mentioned in any image-column in the database - and there might be some image-columns in your store that are not in core, so most of these types of add-ons/scripts would have to be modified for the individual store. You may also have images mentioned in langugage-files, mentioned in text on a infopage or hard-coded in somewhere.
It might be possible to look for images that haven't been loaded in a long time, but I'm not sure that would be any better.

//Daniel

Re: Delete Unused Images

Posted: Mon Sep 30, 2024 8:40 am
by frankl
I have an addon for that, I'll put it up!

app.php/addons/free_addon/image_cleaner/

Re: Delete Unused Images

Posted: Sun Oct 06, 2024 6:51 pm
by GetSirius
Thank you for this addon! I gave it a run on my test installation and it works for me. I really appreciate this addon, it will save me a lot of time. I posted a wishlist to the addon Discussion/Support.