Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Orphans Media

231 sites Security covered
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.

Activity

Total releases
3
First release
Feb 2025
Latest release
6 months ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.2 Stable Dec 20, 2025
1.0.1 Stable Jul 5, 2025
1.0.0 Stable Feb 8, 2025