Delete Unused Images

Open to all! Ask other shopowners for help.
Post Reply
GetSirius
Member
Posts: 50
Joined: Wed Mar 17, 2021 7:15 pm
Phoenix Version:
Has thanked: 14 times
Been thanked: 2 times

Delete Unused Images

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Delete Unused Images

Post 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
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
frankl
Builder
Posts: 159
Joined: Tue Feb 23, 2021 8:39 pm
Phoenix Version: v1.1.0.4
Has thanked: 17 times
Been thanked: 25 times

Re: Delete Unused Images

Post by frankl »

I have an addon for that, I'll put it up!

app.php/addons/free_addon/image_cleaner/
GetSirius
Member
Posts: 50
Joined: Wed Mar 17, 2021 7:15 pm
Phoenix Version:
Has thanked: 14 times
Been thanked: 2 times

Re: Delete Unused Images

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply