I have been asked to delete a file that has incorrect legal information on it from a website so it has to go. My users could not do it.

The site is running drupal 8.9.13 and I have installed the module file_delete

When I try to delete the file I get the following error message:

The file ND Pamphlet re Employee Assistance Program .pdf cannot be deleted because it is in use by the following modules: file.
Click here to see its usages.

There is one reference to a node that does not use this file. Though it may have once been linked to on that node.

I tried deleting the node itself - as it was relatively small and I thought it could be recreated. The error however remains. When I now look at the usage information for the file I see the following:

enter image description here

Caches have been cleared and cron run several times. How do I remove this file and this non-existent reference?

Additionally, why does this happen and how can it be avoided in the future?

  • Hi, tanbog! Any updates regarding this? Looks like I have the same issue and any suggestions are appreciated. Commented Aug 12, 2021 at 7:45
  • I had the same issue and found that drupal.org/project/file_delete_ui was able to let my admin users delete files without checking file usage. Admins must be careful though...
    – bohemier
    Commented Sep 13, 2021 at 15:26


Your Answer

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

Browse other questions tagged or ask your own question.