Media Cleaner


Clean your Media Library from the media which aren’t used in any of your posts, gallery and so on. It features an internal trash, moving the files in there temporarily for you to make sure the files aren’t actually in used; once checked, you can trash them permanently. Before using this plugin, make sure you have a proper backup of your files and database. This is the most important step on the usage of this plugin as you can’t trust any file deletion tools. The Pro version of this plugin brings also scanning to the /uploads folder and will detect which files aren’t registered in the Media Library, not used in your content and so on. Retina images are also detected and supported, shortcodes, HTML in sidebars and of course your posts, pages and all post types.

This tool is a knife. I try to make this knife perfect. However, this is still a knife, and in the hands of somebody who doesn’t understand it and just use it without thinking, it might end badly. Don’t use it you you don’t have any backup, or if you don’t know what it does.

INCOMPATIBILITY. If you are not using WordPress naturally and using plugin to edit your posts, this plugin will not be able to detect how your images are used. For instance, Visual Composer is not supported as for now.

UNIQUE PLUGIN. Such a plugin is difficult to create and to maintain. If you understand WordPress, you probably know why. This plugin tries its best to help you. Get used to it and you will get awesome results. This is the only plugin to propose those functions and even a dashboard to cleanup your WordPress install from unused files.

DASHBOARD. Those file will be shown in a specific dashboard. At this point, it will be up to you to delete them. Files detected as un-used are added to a specific dashboard where you can choose to trash them. They will be then moved to a trash internal to the plugin. After more testing, you can trash them definitely.

FREE / PRO. The Free version of the plugin works with the media available in your Media Library. The Pro version adds file scanning to your physical /uploads directory.

AGAIN, BE CAREFUL. Again, this plugin deletes files so… be careful! Backup is not only important, it is necessary. Don’t use this plugin if you don’t understand how WordPress works. This is a knife, you need to understand what it does and how before using it.

It has been tested with WP Retina 2x and WPML.


  • Media -> Media Cleaner


  1. Upload media-file-cleaner to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go in the Settings -> Media Cleaner and check the appropriate options
  4. Go in Media -> Media Cleaner


Installation Instructions
  1. Upload media-file-cleaner to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go in the Settings -> Media Cleaner and check the appropriate options
  4. Go in Media -> Media Cleaner
Is it safe?

No! 🙂 How can a plugin that deletes files be 100% safe? 😉 I did my best (and will improve it in every way I can) but it is impossible to cover all the cases. On a normal WordPress install it should work perfectly, however other themes and plugins can do whatever they want do and register files in their own way, not always going through the API. I ran it on a few big websites and it performed very well. Make a backup (database + uploads directory) then run it. Again, I insist: BACKUP, BACKUP, BACKUP! Don’t come here to complain that it deleted your files, because, yes, it deletes files. The plugin tries its best to help you and it is the only plugin that does it well.

What is ‘Reset’ doing exactly?

It re-creates the Media Cleaner table in the database. You will need to re-run the scan after this.


Does what it says but needs some care

When I first used the plugin, it marked post thumbnails as “not in use”. That could be remedied with setting the right option in the settings (which I didn’t see at first because of a poor wording at the time). Jordy fixed a related minor problem in the code very swiftly.

After that, I had no problems at all with this plugin. It finds the images not in use and puts them in a separate trash folder if I “delete” them. I then wait some time to see if any of the image links are broken (which they weren’t) before emptying the trash. In the case mentioned above (wrongly marked post thumbnail), a simple click was all that was needed to restore the image to its original location.

3gigs of extra uploads gone

While moving my site I realized I had way too many extra image copies or unused files and went hunting for a solve. Media Cleaner’s free version found about 3gb of files and quickly got rid of them without any signs of issues so far. Can’t speak for the pro version and deeper level analysis yet (it’s slowly trying to scan things) but so far, very good.

This is the one that works!

I asked the author of my current theme (real estate theme) to have the feature to be able to delete pictures from the system once the property which had those pictures was deleted. They said they couldn´t help. Then I bought a plugin (Theia Upload Cleaner) which was supposed to do this, but was complicated and deleted files that were actually in use! Asked for support but didn´t get my problem solved. I gave a try to this plugin and works great. You cannot go wrong with this plugin.

Deleted All Media Files

All this info on description also plugin saying:
“this is still a knife, and in the hands of somebody who doesn’t understand it and just use it without thinking, it might end badly”

Is totally useless and pointless. There are 5 total buttons to this plugin;
Scan -> Scan media library
Delete -> Delete selected items
Ignore -> Ignore selected items
Delete All -> Delete all found issues
Reset -> Reset status

So, it’s not a rocket science, the plugin suppose to find unused uploaded media elements and help you delete them easily. I really have hard time understanding how can you use this plugin wrongly.

Problem is plugin does not work. Here I will tell what happened. I took a full cPanel backup before using this plugin so nothing to worry on my end. I installed it and activated then I clicked on Scan then it pretty much showed all 381 media items as issues in the list. That threw me off a bit because it’s not suppose to but I assumed it may have found unused version of files like some other cleaning plugins do. Once media uploaded their different resolution copies gets saved, so I thought plugin found those. Then I clicked delete all, it deleted entire media library, all 381 media items gone.

After all, if you are incapable of creating a reliable plugin that does what it promises on a newly installed latest WordPress and deletes all media files, then you should probably remove it from here, correct issues within it then put it back.

I am totally disguised how bad talking defensive author putting blame on people because they trusted his plugin would do what it promises and did not backup their website. Very unprofessional!

Read all 41 reviews

Contributors & Developers

“Media Cleaner” is open source software. The following people have contributed to this plugin.




  • Update: Bulk analyze/prepare galleries, avoid the first request to time out.
  • Add: Many option to make the processing faster or slower depending on the server.
  • Fix: Handle server timeout.
  • Add: Pause button and Retry button.


  • Update: Safest default values.


  • Add: Information about how a certain media is used (Edit Media screen).
  • Fix: Check / Create DB process.
  • Fix: Plugin was not working well with themes using Background/Header.
  • Update: A bit of cleaning.


  • Update: Core was re-organized and cleaned. Ready for nice updates.


  • Fix: Little issue when inserting the serial key for the first time.
  • Update: Compliance with the rules, new licensing system.
  • Update: Moved assets.
  • Info: There will be an important warning showing up during this update. It is an important annoucement.


  • Fix: Plugin was not working properly with broken Media metadata. It now handles it properly.
  • Info: If you want to give me a bit of motivation, write a review on


  • Fix: When over 1 GO, was displaying a lower size value.
  • Fix: Counting wasn’t exact with a Filesystem scan.
  • Info: Please read the previous changelog as it didn’t appear in WP for some reason.
  • Add: Check Posts also look for the Media ID in the classes (more secure).
  • Info: If you want to give me a bit of motivation, write a review on


  • Add: Now the Media can be recovered! You can remove your Media through the plugin, make sure they are not in use (by testing your website thoroughly) and later delete them definitely from the trash. I think you will find it awesome.
  • Update: Nicer internal icons rather than the old images for the UI.
  • Update: Faster and safer for post_content checks.
  • Update: This is a big one. The plugin is more clear about what it does. You need to choose either to scan the Media or the Filesystem, and also against what exactly. There has also been a few fixes and it will work on more big installs. If it fails, you can remove a few scanning options, and I will continue to work on making it perfect to support huge installs with all the options on.


  • Update: Show a better edit media screen.
  • Update: Will show the same number of items as in the Media Library (before it was fixed to 15 items per page).
  • Fix: Was displaying warning if the number of items per page in the Media page is not set.


  • Fix: HTML adapted to WP 4.5.1.
  • Fix: Doesn’t break if there is an error on the server-side. Display an alert and continue.
  • Update: Can select more than one file for non-Pro.
  • Fix: Issue with PHP 7.


  • Add: Option for resolving shortcode during analysis.
  • Update: French translation. Big thanks to Guillaume (and also for all his testing!).
  • Info: New name, fresh start. This plugin changed completely since it very first release 🙂


  • Add: Delete the unused directories.
  • Add: Doesn’t break when there are too many files in the system.
  • Add: Pro version with better support.
  • Update: Improved detection of unused files.
  • Fix: UTF8 filenames skipped by default but can be scanned through an option.
  • Fix: Really many fixes 🙂
  • Info: Contact me if you have been using the plugin for a long time and love it.


  • Add: Inclusion of gallery post format images.
  • Fix: Better gallery URL matching.
  • Info: Thanks to syntax53 for those improvements via GitHub ( Please review Media Cleaner if you like it. The plugin needs reviews to live. Thank you 🙂 (


  • Fix: Cross site scripting vulnerability fixes.
  • Change: Many enhancements and fixes made by Matt ( Please thanks him 🙂
  • Info: Please perform a “Reset” in the plugin dashboard after installing this new version.


  • Fix: Scan for multisite.
  • Change: options are now all enabled by default.
  • Fix: DB issue avoided trashed files from being deleted permanently.


  • Works with WP 4.
  • Gallery support.
  • Fix: IGNORE function was… ignored by the scanning process.


  • Add: thumbnails.
  • Add: IGNORE function.
  • Change: cosmetic changes.
  • Add: now detects the custom header and custom background.
  • Change: the CSS was updated to fit the new Admin theme.


  • Change: the MEDIA files are now going to the trash but the MEDIA reference in the DB is still removed permanently.
  • Stable release.
  • Change: Readme.txt.


  • Add: check the meta properties.
  • Add: check the ‘featured image’ properties.
  • Fix: keep the trash information when a new scan is started.
  • Fix: remove the DB on uninstall, not on desactivate.


  • Add: progress %.
  • Fix: issues with apostrophes in filenames.
  • Change: UI cleaning.


  • Add: options (scan files / scan media).
  • Fix: mkdir issues.
  • Change: operations are buffered by 5 (faster).


  • First release.