Use the Hackathon EAV cleaner module for this. After installation you can use the command eav:media:remove-unused
Also you can do it by installing the module below and running these commands.
composer require ekouk/imagecleaner “dev-master”
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
Run in check only mode which will report the number and size in Mb of unused images.
bin/magento ekouk:cleanimages
Then run this command to delete the files.
bin/magento ekouk:cleanimages -d
2 thoughts on “Delete unused images from my media folder ?”
Comments are closed.