Save disk space and bring some order to the chaos of your media library by removing and preventing duplicate files.
Media Deduper will find and eliminate duplicate images and attachments from your WordPress media library. After installing, you’ll have a new “Manage Duplicates” option in your Media section.
Before Media Deduper can identify duplicate assets, it will build an index of all the files in your media library, which can take some time. Once that’s done, however, Media Deduper automatically adds new uploads to its index, so you shouldn’t have to generate the index again.
Need faster indexing? Check out Media Deduper Pro.
Once up and running, Media Deduper provides two key tools:
Use this plugin at your own risk. The plugin developers are not responsible for any lost data or site issues as a result of using this plugin.
Media Deduper comes with a “Smart Delete” option that prevents a post’s Featured Image from being deleted, even if that image is found to be a duplicate elsewhere on the site.
If a post has a featured image that’s a duplicate file, Smart Delete will re-assign that post’s image to an already-in-use copy of the image before deleting the duplicate so that the post’s appearance is unaffected. This feature only tracks Featured Images, and not images used in galleries, post bodies, shortcodes, meta fields, or anywhere else.
Looking for more features? Media Deduper Pro includes features for image fields from several popular plugins as well.
Note that duplicate identification is based on the data of the files themselves, not any titles, captions or other metadata you may have provided in the WordPress admin.
Media Deduper can differentiate between 1.) media items that are duplicates because the media files they link to have the same data and 2.) those that actually point to the same data file, which can happen with a plugin like WP Job Manager or Duplicate Post.
As with any plugin that can perform destructive operations on your database and/or files, using Media Deduper can result in permanent data loss if you’re not careful. Back up your data before you try out Media Deduper! Please!
Use this plugin at your own risk. The plugin developers are not responsible for any lost data or site issues as a result of using this plugin.
Need more support? Media Deduper Pro includes dedicated support from Cornershop Creative.
Media Deduper requires PHP 5.3 or later.
media-deduper
directory to your plugins directory (typically wp-content/plugins)Media Deduper looks at the original file uploaded to each attachment post and computes a unique hash (using md5) for that file. Those hashes are stored as postmeta information. Once a file’s hash is computed it can be compared to other files’ hashes to see if their data is an exact match.
Because there’s no way of knowing which of the duplicates is the “real” or “best” one based on your preferred metadata, etc.
NO! Because the list includes every copy of your duplicates, you’ll likely always want to save one version, so using Delete Permanently to delete all of them would be very, very bad. Don’t do that. You’ve been warned.
Instead, we recommend using the Smart Delete action (which is also found in the Bulk Actions menu). Smart Delete will delete the selected items one by one, and refuse to delete an item if it has no remaining duplicates. For example, if you have three copies of an image, and you select all three and choose Smart Delete, two copies will be deleted and the third will be skipped.
Again, we strongly recommend backing up your data before performing any bulk delete operations, including Smart Delete.
At this time, Media Deduper only identifies and blocks duplicate media files manually uploaded via the admin dashboard — it does not block duplicates that are imported via WP-CLI or the WordPress Importer plugin.
The free version does not include plugin support. Media Deduper Pro integrates with a number of popular plugins, including WooCommerce and Yoast SEO.
The git repository should be publicly available at https://bitbucket.org/cornershopcreative/plugin_media-deduper. Feel free to fork, edit, make pull requests, etc.
set-screen-option
hook, and we haven’t run into this issue in the wild, but now it’s fixed anyway.