Do you want to clean up your WordPress media library?
Every time you upload a file media, WordPress creates several copies. These files aren’t used anywhere on your website and can take up a lot of storage space on your hosting server.
In this article, we will show you how to easily clean up your WordPress media library.
Why Clean Up WordPress Media Library?
When you upload an image, WordPress creates multiple image sizes by default. Some WordPress themes and plugins may also request additional image sizes.
These copies take up disk space on your WordPress hosting server. They also increase the size of your WordPress backups, so it takes longer to back up, transfer, and restore your website. Depending on your hosting plan, you may even have to pay for extra storage.
You may be able to free up storage, create backups more quickly, and save money by cleaning up your media library.
Just be aware that cleaning up unused media files means deleting them forever. You can’t undo this, so make sure you create a complete WordPress backup before going any further.
With that done, let’s see how you can clean up the WordPress media library. Simply use the quick links below to jump straight to the method you want to use:
Video Tutorial
If you’d prefer written instructions, then just keep reading.
Method 1: Clean Up WordPress Media Library Using Media Cleaner (Quick and Easy)
The easiest way to find and remove unnecessary media files is by using the Media Cleaner plugin. This straightforward plugin is the best choice if you want to quickly scan your library and remove any unnecessary images.
The first thing you need to do is install and activate the Media Cleaner plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, head over to Meow Apps » Media Cleaner to analyze your WordPress media library.
To start, we want to scan for images that aren’t used by checking the box next to ‘Content.’
Then, go ahead and click on ‘Access Media Cleaner Dashboard.’
On the next screen, click on ‘Scan.’
After a few moments, Media Cleaner will show all the files it recommends you remove from the media library. It also displays the reason why it wants to remove each file from your WordPress blog.
Simply go ahead and check the box next to each file that you want to permanently delete.
When you are ready, click ‘Delete’ to remove these files from your WordPress website.
Method 2: Clean Up WordPress Media Library Using Media Deduper (Recommended)
If you simply want to remove unnecessary media files from your library, then Media Cleaner is a great choice. However, if you want to avoid duplicate images in the future, then we recommend using Media Deduper instead.
This plugin automatically scans media files as you upload them to the media library and then flags any duplicates. However, the plugin does need to build an index of all your media files, so it takes a bit longer to set up.
First, you need to install and activate the Media Deduper plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, go to Media » Manage Duplicates and then click on the ‘Index Media’ button to analyze your media library.
This can take a while, depending on the speed of your internet connection and the size of your media library.
When it’s finished, click on the ‘Manager Duplicates Now’ button that appears.
Media Deduper will now show all the unused and duplicate files that you may want to remove.
You can permanently delete any of these images, but we recommend using the Smart Delete feature instead.
If a post is using a duplicate file as a featured image, then Smart Delete will re-assign a different copy of that image before deleting the duplicate. From the visitor’s point of view, the post will still be using exactly the same featured image.
To use Smart Delete, simply open the dropdown menu and select ‘Smart Delete.’
After that, check the box next to each image you want to remove and then click on the ‘Apply’ button. Media Deduper will go ahead and remove all these files.
The plugin will now monitor all the media you upload to WordPress. If it detects any duplicate files, then it will add them to the Media » Manage Duplicates screen automatically.
With that in mind, make sure you visit this screen occasionally to review and remove any unnecessary files.
Optimizing Your Media Files
Once you’ve deleted the duplicate images on your website, it’s a good idea to optimize the rest of your media files.
A lot of new website owners directly upload images from their phones and cameras. These high-quality images are often too big and take up lots of storage space. This can make your backups bigger and affect WordPress speed and performance.
To fix this problem, see our tips on how to optimize images for web performance before uploading them to your website. You can also use a WordPress image compression plugin to automatically optimize your media files without losing quality.
We hope this article helped you learn how to clean up the WordPress media library. You may also want to see our guide on how to choose the best web design software or the most common WordPress errors and how to fix them.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Greg says
Hi there,
Thank you for this guide. I noticed the guide was updated in July 2023 but it appears Media Deduper hasn’t been tested for the last 3 major WordPress updates and was last updated 5 months ago?
Is it still safe to use this?
Kind regards,
Greg
WPBeginner Support says
When we tested the plugin for the update it was still working, for the concern with that message, we would recommend taking a look at our article below!
https://www.wpbeginner.com/opinion/should-you-install-plugins-not-tested-with-your-wordpress-version/
Admin
Mina says
Thank you the article, it was very helpful. A quick question: can I uninstall the plugin after I am done? will uninstalling it reverts everything or it okey to remove the plugin after I am done using it?
WPBeginner Support says
You can remove it after running it at the moment
Admin
Andi Schwartz says
THANK YOU for this!! Saved me a TON of disk space cleaning up all the unused images!
WPBeginner Support says
Glad our guide was helpful
Admin
Laurel says
Thank you for this tutorial! It was so helpful!
WPBeginner Support says
Glad our guide was helpful
Admin