Duplicate Media Guard
Duplicate Media Guard is the easiest way to replace existing media files in WordPress and prevent duplicate uploads — all without breaking your URLs or losing your attachment IDs. Need to replace a media file in your WordPress Media Library? This plugin adds a Replace Media button directly in the Me
Duplicate Media Guard is the easiest way to replace existing media files in WordPress and prevent duplicate uploads — all without breaking your URLs or losing your attachment IDs.
Need to replace a media file in your WordPress Media Library? This plugin adds a Replace Media button directly in the Media Library. Simply pick a file, upload the replacement, and choose whether to keep the existing filename and URL or update all links automatically. The attachment ID is always retained, so nothing breaks.
Beyond media replace, Duplicate Media Guard keeps your Media Library clean by detecting duplicate uploads before they happen. Filename checks catch common re-uploads, exact file hashing identifies byte-identical images, and perceptual hashing can spot resized or recompressed copies even when the filename is different.
Why use this plugin?
- Replace media in WordPress without creating a new attachment or breaking existing links.
- Stop wasting storage on accidental duplicate uploads.
- Keep your Media Library organized with smart duplicate detection.
- Works with the standard WordPress Media Uploader — no custom UI to learn.
How Replace Media works:
Enable Enable Media Replace in the plugin settings. A Replace media link then appears in the Media Library for any file you have permission to edit. Upload the new file and choose one of two replace modes:
- Replace file only — keeps the same filename, URL, and folder. The replacement must be the same file type.
- Replace file and update all links — uses the new filename and automatically updates all matching references stored in WordPress content and metadata.
The attachment ID is preserved in both modes.
Duplicate detection examples:
- logo.png and logo.png → Duplicate
- logo.png and logo.jpg → Duplicate (when extension check is disabled)
- banner.webp and banner.webp → Duplicate
- photo.jpg and a resized or recompressed copy.webp → Possible visual duplicate (when visually similar detection is enabled)