Media Mage
Media Mage scans your media library for two kinds of clutter: Duplicate files – the same image uploaded more than once under different names. Matched on MD5 content hash, so a renamed copy is still caught. Unused media – attachments that nothing on the site appears to reference. A tool that deletes
Media Mage scans your media library for two kinds of clutter:
- Duplicate files – the same image uploaded more than once under different names. Matched on MD5 content hash, so a renamed copy is still caught.
- Unused media – attachments that nothing on the site appears to reference.
A tool that deletes files is only as good as the search it runs first, because anything the search misses gets reported as unused and then deleted. Most of the work in this plugin is in that search, and in the guards that sit between the search result and the delete.
What counts as a reference
Media Mage checks all of the following before it will call a file unused:
- Post content of any post, page or custom post type, including trashed posts
- Post meta – ACF fields, Elementor data, page-builder payloads, plain custom fields, wherever the value contains the URL
- Term meta, user meta and comment meta, again wherever the value contains the URL
- Comment content
- The options table – theme mods, customizer values, widget areas
- Featured images ( _thumbnail_id ) and the attachment’s own post parent
- Site logo and site icon
- WooCommerce product galleries
- Oxygen Builder base64-encoded layout data ( _ct_builder_shortcodes , _ct_builder_json , ct_style_sheets , ct_components_classes )
- Gutenberg block IDs and wp-image-N classes, so a block that carries an ID and no URL still counts
Each of those is checked against every URL the attachment can appear under: the full-size file, every generated size variant, the -scaled version and the preserved original. Inserting an image at Medium embeds the medium URL and never the full-size one, so checking only the full-size URL is how a live image ends up on an unused list.
URLs are also matched in their JSON-escaped form ( \/ instead of / ), which is how Elementor, Divi and Gutenberg block attributes store them.