1

Every time I remove or replace an image in my Drupal 7 site (via image-field or CKeditor) it remains stored in the site's folder (x3 times at least for every style). Almost always it takes me about 3 MB of storage and creates a mess in the "styles" folder.

Is there a way (or module) to issue a command to remove all image files which are not being used (anymore) at my site?

2

The following drush command:

drush image-flush

may be used to remove all the image style copies generated as image styles via image-field or CKeditor. This is completely safe, as it will not touch the originals.

Those still in use will be regenerated when needed. Those no longer used will not not be regenerated.

As noted in a comment by cptstarling:

If you don't have access to drush, you may consider the Image style flush module.

1
1

Normally, in a recent Drupal installation files are being deleted automatically when they're not related to node content. Update to the latest Drupal core and run cron (make sure that any occurance in nodes has been removed), also clear Drupal's cache to make sure.

AFAIK CKeditor works independently from the Drupal core, so I guess you'll have to delete files manually there, in its CKfinder.

1
  • 1
    You are talking about image originals uploaded as managed files. I believe this is irrelevant to the OPs problem. Jun 22 '15 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy