Media duplicates
This module helps identify and prevent duplicate media files from being uploaded to your Drupal site. It can generate reports of existing duplicates or actively block new duplicate uploads, with options to control how strictly duplicates are handled.
This module allows the comparison, detection and restriction of duplicate media
entities within a site.
Cleaning up the duplicate media items is currently outside the scope of this module. That's because it's a hard task. Depending on media usage in fields, usage across translations, usage in token embedded media, usage in config (blocks, etc).
Installation
- To install this module,
composer requireit, or place it in your modules folder and enable the module. - Generate initial checksums if you have existing media items. You can use the form linked from the status page or run the
drush media-duplicates:checksums:rebuildcommand. (Currently only supports Drush 9+)
Usage
- Install this module as early as possible in your development process to reduce any technical debt you later have to clean up.
- Module allows progressive enhancement by having settings that
- Allow you to generate a report but don't restrict duplicates.
- Restrict new duplicates but still allow you to save existing.
- Restrict all duplicates, both new and existing.
- Use in conjunction with Entity Usage to help find where duplicates are used and consolidate.
Plugin architecture
This module allows media type developers to implement a MediaDuplicatesChecksum plugin to integrate with this module.
Alternatives
- https://www.drupal.org/project/media_dupe_detect seems to be very similar - would be great if someone could do a comparison. Also see #3517939: Difference with similar modules and possible combining efforts?
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
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 2.0.4 | Stable | 9–11 | Mar 19, 2026 | ||
| 3.0.0-alpha1 | Pre-release | 11 | Mar 19, 2026 | ||
| 3.x-dev | Dev | 11 | Mar 17, 2026 |