How to Audit and Remove Unused Media in Drupal Using Entity Usage

How to Audit and Remove Unused Media in Drupal Using Entity Usage

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.

Reference: Getting Rid of Unused Media with the Entity Usage Module (28 August 2025)

Disclosure: This content is produced with the assistance of AI.

Disclaimer: The opinions expressed in this story do not necessarily represent that of TheDropTimes. We regularly share third-party blog posts that feature Drupal in good faith. TDT recommends Reader's discretion while consuming such content, as the veracity/authenticity of the story depends on the blogger and their motives. 

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Upcoming Events

Latest Opportunities