Unused media files (.jpeg .mp4 etc.) are remaining permanently even though unused.

This is shown in the /admin/content/files page in our Drupal 8.6.3 system.

It could be that, at migration from Drupal 7, we weren't careful enough.

Is there any way I can force the deletion of these files using Drupal functionality?

I haven't seen any fully ready a Drupal 8 module to remedy this seemingly common situation.

1 Answer 1


I've come across this before with webform submission files and the site getting confused about the path.

If you actually try and view 1 of the files in the list does it exist? As you may find it doesn't exist but drupal has kept a record of the file in the database. When drupal tries to do is file tidy up on cron run it's erroring because the file its trying to delete doesn't exist (But its not then smart enough to delete the row out of the database)

The safest solution would be to manually recreate these files in the position /admin/content/files thinks it should exist and then rerun the cron and it should delete your test file and the row in the database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.