Recently, I saw an email in my inbox from my hosting company, “You’ve used 95% of your storage space.”
It was time to clean up my media library and free up some space. But when I opened my WordPress media library, it was dreadful.
Six years of running my website had created a monster – thousands of images, PDFs, and files I barely recognized stared back at me. The sheer amount of stuff made me back away slowly and pretend I didn’t see it.
So, I looked around online and found this tool that changed everything. Instead of spending hours manually checking each file (which, let’s be honest, I was never going to do), this solution helped me clean up my media library in under 30 minutes.
Want to know how I did it? Let me show you the exact process I used when I finally tackled my own WordPress media nightmare – 2,343 files to be exact.
Important: This tool lets you revert any changes with 1-click. That said, I still recommend that you take a backup of your WordPress site before we begin.
I learned this the hard way – always, ALWAYS have a backup before making major changes like cleaning your media library. It takes a couple of minutes and can save you hours of panic.
The Tool I Used: Search & Replace Everything
The tool I used is Search & Replace Everything created by the developers of WPCode.
Instead of spending hours manually checking each file, it scanned my entire site and gave me a clear picture of what was actually unused.
The interface is straightforward – no confusing technical jargon or complicated settings to wade through.
What really sold me was its safety features. This tool shows you the path where each image appears before you touch anything. It also includes a list of database occurrences.
This saved me from what could have been a massive headache of accidentally deleting important images.
So now that you know the tool, let’s head on to the steps to get this done.
Step 1: Install Search & Replace Everything
For the Lite version, in your WordPress dashboard, head over to Plugins » Add New and search for “Search & Replace Everything”. Install and activate this plugin on your site.
Need help installing the plugin? Follow our guide: How to Install a WordPress Plugin.
For this tutorial, I’ll be using the Pro version so you can see what this plugin is truly capable of. To get the Pro plugin, go to the Search & Replace Everything plans page.
Choose your plan and once you’re signed up, you’ll be logged into your own dashboard like this:
Here, you can download the plugin file and copy your license key for the next step.
Now go to your WordPress admin panel, head over to Plugins » Add New » Upload Plugin.
Select the plugin file you downloaded to your computer. Install and activate the plugin.
Next, go to Tools » WP Search & Replace » Settings page. You’ll see an option to paste your license key that you copied from your account dashboard. Hit the Verify Key button and you’re all set.
Now you’re ready to use the plugin to remove unused media like images and videos from your media library.
Step 2: Scan Your Site for Unused Media
In the same page, switch to the ‘Remove Unused Media’ tab in the top menu bar. Here you can click on the ‘Begin Scan’ button and the plugin will scan your site. It will take a few minutes depending on the number of files in your media library.
My site had thousands of files, so it took about 3-4 minutes.
Once the scan is done, you’ll see a report of how many files it found along with a warning of how many of these files are used outside of posts. This would mean media files that are used in widget areas like sidebars and footers,
I could run through this list, select the files I didn’t want, and delete them.
Sharing a small tip here, I had more files I wanted to delete than save, so I chose to Select All files by clicking on the checkbox right at the top next to ‘Thumbnail’. Then I went through the list and unselected the ones I wanted to keep. It was just much faster that way.
That’s it! Your media library is cleaner and you have more storage space now. Before we wrap up, I’m going to show you one more feature of this tool that’s an absolute game changer.
Bonus: Replace Any Text and Media Across Your Website
This plugin does a lot more than delete unused media files. It lets you find and replace text and media as well.
This came in handy when I had to update my business phone number across all pages. This plugin did it in seconds – without opening a single page.
If you’ve ever had to update your logo, you’ll know you had to replace the logo in multiple places on your site. Chances are you missed one and spotted it weeks later.
Like this, there are times when you might want to replace an image or text you’re using across your site.
This plugin lets you do that with one move.
I’ve had to replace an image of the pricing page of an affiliate product which I had used in 18 different blog posts.
So for instance, to replace an image, go to the Replace Media tab. You’ll see all the media files in your library. Choose the one you want and you’ll see a Replace button appear over it.
On the next page, you can choose the file you want to replace it with and hit the ‘Replace Source File’ button.
That’s it. The image will be updated anywhere it’s being used on your site. I love it! It made things so much easier.
How Much Does Search & Replace Everything Cost?
There’s a Lite version available in the WordPress plugin repository for free. The pro plugin starts at $29 per year with unlimited image replacements, unlimited users and so much more.
Here’s what the plugin offers:
- 🔎 Search and replace text across your entire WordPress site
- 👀 Preview all changes before they go live
- ↖️ One-click restore if you need to undo changes
- 🔄 Replace images site-wide without breaking links
- 🗑 Remove unused media files safely
- 🕵🏼♂️Track all changes made to your database
- 🔗 Built-in integration with Gutenberg editor
- 🧐 Scan for media usage across your entire site
- ❌ Eliminate duplicate images
- 💾 Save storage space by cleaning unused files
- 👍🏼 Handle serialized data without breaking anything
- 🤲🏼 Side-by-side comparison of changes
Get started with Search & Replace Everything »
After putting this tool through its paces on my own messy WordPress sites, I can honestly say it’s changed how I manage my media files. What used to be a task I’d constantly put off (let’s be real – who enjoys cleaning up thousands of media files?) is now something I can handle in an afternoon.
Next, I’ll answer questions you might have.
Frequently Asked Questions on Deleting Unused Media
Why You Need to Delete Unused Media in WordPress?
Here’s what finally made me tackle the mess of unused media:
- My monthly backup ZIP files were getting huge
- I spent way too much time scrolling through files to find what I needed
- My site’s loading speed was suffering
- I was about to pay for more storage space I didn’t actually need
What counts as “unused” media?
Media files that aren’t linked anywhere on your site – not in posts, pages, widgets, menus, or theme settings. But be careful: some files might appear unused but are actually part of your theme or used in custom code. Search & Replace Everything will catch that for you.
Will removing unused media speed up my site?
Yes, but the impact on website speed and performance depends on your situation. In my case, removing 2GB of unused images improved load times by 0.8 seconds. Fewer files means faster backups and better server performance.
What if I need the files again later?
Always download a backup of your media library before deleting anything. I keep mine organized by date in a folder on my computer. Better safe than sorry!
Can’t I just delete files manually from the media library?
You could, but it’s risky. Manual deletion doesn’t show you where files might be used in hidden areas like widgets or custom CSS.
How often should I clean up my media library?
I would recommend a scan monthly and a deep clean quarterly. Regular maintenance prevents the overwhelming buildup that made me avoid this task for years.
What about images in old blog posts, should I delete them?
Even if a post is old, if it’s still published, keep the images. They might be bringing in traffic from Google Images or Pinterest.
Will this affect my site’s SEO?
Removing genuine unused files can actually help SEO by improving site speed and crawl efficiency. But make sure you keep images that are actually being used in your content.
That’s it. I hope you found this step-by-step tutorial helpful. Next up, you might also want to learn how to speed up your website »
Leave a Reply