Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Orphans Media

244 sites Security covered Drupal 10–11
View on drupal.org

This module helps administrators find and delete media files that are no longer used in any content. It provides a way to scan for orphaned media, filter by type, and delete them in batches, with options to preview before deletion and integrate custom logic into the deletion process.

Orphans Media Delete is a lightweight and efficient module designed to help administrators identify and delete unused media entities in their Drupal site. Inspired by the Audit Files module, this tool provides a flexible administrative interface to manage orphaned media and maintain a clean, optimized media library.

Features

  • List Unused Media: Scan your site to identify media entities that are not referenced in any content.
  • Filter by Media Bundle: Limit the search to specific media bundles, giving you control over which types of media to target.
  • Delete Unused Media: Remove orphaned media directly from the admin interface to free up storage and improve site performance.
  • Batch Operations: Handles large media libraries efficiently using Drupal's batch processing system.
  • Safe Workflow: Prevent accidental deletion by displaying a detailed preview of unused media before removal.
  • Customizable Workflow with Events:
    • Pre Delete Event: Triggered before a media entity is deleted, for additional processing or logging
    • Post Delete Event: Triggered after a media entity is deleted, providing a clone object of deleted media entity, enabling cleanup tasks or notifications.

Use Cases

  • Maintaining a well-organized media library.
  • Reducing storage usage by removing obsolete media entities.
  • Simplifying content management for administrators.
  • Adding custom logic to deletion workflows using provided events.

Requirements

  • Compatible with Drupal 10 and above.
  • Media module must be enabled and in use on the site.

How It Works

The module analyzes all media entities in your site and cross-checks their usage across content entities. Administrators can filter results by media bundle to refine their search. Orphaned media are displayed in a report accessible from the administrative interface. After review, unused media can be deleted in bulk.

For developers, the module emits pre delete and post delete events, allowing for custom workflows or additional processing during the deletion process.

Depends on

Dependencies of the latest stable release

  • media Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Dec 2024
Latest release
8 months ago
Releases (12 mo)
1 ▼ from 3
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.2 Stable 10–11 Dec 20, 2025
1.0.1 Stable 10–11 Jul 5, 2025
1.0.0 Stable 10–11 Feb 8, 2025
1.0.0-rc1 Pre-release 10–11 Dec 1, 2024