How to Audit and Remove Unused Media in Drupal Using Entity Usage
- Source: Getting Rid of Unused Media with the Entity Usage Module by Joshuami (28 Aug 2025)
In a recent blog post, Joshua Mitchell details a practical method for identifying and archiving unused media—particularly PDFs—on Drupal sites using the contrib Entity Usage module. By integrating the module with administrative Views and the Entity Usage Views Field, editors can visualize and filter content usage, including embedded references via CKEditor, layout builder, and fields.
The workflow includes custom Views using aggregation to identify media with null usage counts and additional filters to catch edge cases like hard-coded links and direct S3 uploads. On one site, this audit surfaced over 7,000 unreferenced PDFs, enabling significant storage cleanup and easing WCAG AA compliance checks ahead of a 2026 deadline.


