Skip to main content
drupalreleases
Release: Cms 2.2.3 — Update released for Drupal core (2.2.3)! Release: Easy Breadcrumb 2.0.11 — Minor update available for module easy_breadcrumb (2.0.11). Release: Bootstrap 8.x-3.42 — Minor update available for theme bootstrap (8.x-3.42). Release: Editoria11y Accessibility Checker 3.0.10 — Minor update available for module editoria11y (3.0.10). Release: Editoria11y Accessibility Checker 2.2.24 — Minor update available for module editoria11y (2.2.24). Release: Leaflet 10.4.13 — Minor update available for module leaflet (10.4.13). Release: Flag 5.1.1 — Minor update available for module flag (5.1.1). Release: Layout Paragraphs 3.0.0-beta5 — New beta version released for module layout_paragraphs (3.0.0-beta5). Module Revived: Bootstrap 8.x-3.41 — Theme bootstrap updated after 6 months of inactivity (8.x-3.41). Security Coverage: Component Library — Module component_library now has official Drupal security advisory coverage.

Media Dedupe

No security coverage
View on drupal.org

This module prevents duplicate media entities from being created by checking file content hashes. When a user uploads a file identical to one already stored, the system automatically references the existing media entity instead of creating a new one. This works regardless of file names and covers both the Media Library widget and standalone media add forms.

Media Dedupe

Media Dedupe keeps your media library clean by preventing duplicate media entities from ever being created. When an
editor uploads a file whose contents are byte-for-byte identical to one already stored, Media Dedupe transparently
references the existing media entity instead of creating a new duplicate - no error message, no manual decision, no
clutter.

Detection is content-based (a cryptographic hash of the file), so it works regardless of the file name, and it covers
both the Media Library widget and the standalone /media/add/* forms.

Key features

- Content-hash matching (SHA-256 via File Hash https://www.drupal.org/project/filehash) - not filename-based, so
renamed-but-identical files are still caught and different files that happen to share a name are not falsely flagged.
- Transparent auto-reference - the existing media item is reused automatically; the editor is simply pointed at it. No
"file already exists" dead-end.
- Covers both upload paths - the Media Library upload dialog and the standalone media add form (/media/add/{type}).
- Per-media-type control - enable deduplication globally or restrict it to specific file-based media types.
- Drupal 10 & 11, clean dependency-injected code, passes phpcs (Drupal/DrupalPractice) and PHPStan, and ships with a
Kernel test.

How it works

File hashes are computed and stored by the File Hash module. On upload, Media Dedupe looks up the uploaded file's hash
among existing permanent files. If a match is found, the Media Library and media-add forms are overridden so that the
existing media entity is referenced (or the user is redirected to it) instead of a new duplicate being persisted. If
no match is found, the file is stored normally.

Backfill hashes for pre-existing files once with drush filehash:generate.

Requirements

- Drupal ^10 || ^11
- File Hash (https://www.drupal.org/project/filehash) with at least one algorithm enabled (SHA-256 recommended)
- Core Media Library

Configuration

Settings live at Administration → Configuration → Media → Media Dedupe (/admin/config/media/media-dedupe): a master
on/off switch and an optional restriction to specific media types.

How this differs from similar modules

Several modules address media duplicates, but with a different strategy:

- Media Duplicate Check and similar detect by filename and warn the editor.
- Media Dupe Detect hashes files but only suggests the existing item.

Media Dedupe is the only one that combines byte-exact content hashing with automatic referencing of the existing
entity across both upload paths - the duplicate simply never gets created.

Limitations

- Matching is byte-exact: visually similar but re-encoded/resized images are treated as different files.
- Deduplication is scoped per media type.
- Only local, file-based sources are supported (remote/oEmbed sources such as YouTube are out of scope).

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Aug 2026
Latest release
1 month ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.0-alpha1 Pre-release 10–11 Aug 11, 2026