How to Delete Unused Images on Your WordPress Site
Media files are necessary additions to any website. However, it’s easy for your WordPress Media Library to become bloated with unused files, which can slow down your website and make media management difficult.
Fortunately, managing your Media Library doesn’t have to be this difficult. By cleaning it up regularly and optimizing your images appropriately, you can be sure your media contents are operating at their best, so your site stays fast and performant.
In this post, we’ll discuss various ways to clean up your WordPress Media Library and introduce three image cleanup plugins that can make the process easier.
Let’s get started!
Why you should delete unused images in your WordPress Media Library
When you upload an image to your Media Library, WordPress makes several copies of it. Additionally, different themes and plugins may also request a variety of image sizes. Consequently, your Media Library can amass a lot of files that you may not be aware of.
Ultimately, this can bog down your entire website, as all those images take up space on your server. Another problem that can arise from a cluttered Media Library is oversized website backups. If you have an automatic backup process configured, your backup files can become large and unwieldy.
Depending on your hosting plan, all those extra files could eventually cost you more each month in addition to slowing your site down. Still, it’s important to make at least one copy of your current website before tackling a Media Library cleanout, because the process will involve deleting certain files for good.
Reduce the amount of used storage
The amount of storage space available to you will depend on your host. These limitations are put in place for good reason, as too much media uploaded to your website will eventually decrease its performance.
For example, the more files that are uploaded to a website, the longer it will take to load, and slow site speed may drive visitors away. It can also interfere with the site’s User Experience (UX) when functional site elements take too long to load.
Resize images
There are many factors that contribute to media space usage—one of the most important being image size. By uploading smaller images to your Media Library instead of just downsizing larger images with HTML, you can increase the space available on your server. This should contribute to improved site speeds, both on the front and backends.
Image scaling is also a great way of resizing your images without losing out on quality. In short, it enables you to use the minimum number of pixels to display your image, which directly correlates with a reduction in file size.
What’s more, how you treat images on your website can have a crucial impact on your website’s Search Engine Optimization (SEO). To learn more, check out our in-depth resource on image optimization and SEO.
Use JPG images instead of PNG
Another factor that impacts media space usage is the image file types you use. The two most common are JPG and PNG, but the former is best when it comes to saving space.
When comparing JPG and PNG images side by side, you’ll notice a slight difference in quality. PNGs are often of higher quality, but the difference is so negligible that it isn’t a dealbreaker for the majority of website images. The only time you really need to use PNGs is when you require a transparent image background.
When you use JPG instead of PNG, your images will naturally be of a smaller size. Of course, you can compress (or scale them) further if necessary.
Eliminate duplicate images
While you may sometimes upload multiples of the same image, duplicate images are usually caused by WordPress’ automatic creation of multiple image formats (such as Thumbnail, Medium, and Large). As we mentioned before, this can quickly use up your available storage space, while also slowing your website down.
Fortunately, this is something you can easily put a stop to. Simply head to Settings > Media within your WordPress dashboard:
To prevent the creation of multiple image sizes, simply change the values in each box to 0. Then, click on Save Changes:
With no dimensions in place, WordPress will no longer be able to save multiple sizes of the same image.
Delete unused images and files in your WordPress Media Library
One of the easiest ways to free up storage space and keep your site running at its best is to delete all of your unused files and images.
From the WordPress dashboard, go to Media > Library. To delete a single image, click it, then choose the Delete Permanently option at the bottom of the screen:
A popup will appear on screen. Clicking OK will remove the file from your Media Library.
You can also bulk delete files and images, which is a quicker way of managing unused files. From the Media Library page, click Bulk Select at the top:
Click on all files you’d like to delete, and choose Delete Selected. A popup will appear and, just like above, click OK to permanently remove these images:
It’s not uncommon to “collect” files over time that aren’t necessary. This is why you should repeat this process at least every other month (though, the more frequent the better).
WordPress plugins for unused image cleanup
WordPress’ Media Library is quite intuitive, which is beneficial for even the most experienced users. However, you may find that you need a bit more help when it comes to Media Library management.
Here are three WordPress plugins for image cleanup that you may find useful.
Media Cleaner
Media Cleaner is a simple plugin, but one that makes the removal of unused media files simple. Once installed, this tool will add all files not being used on your website (such as in posts, pages, or galleries) to a temporary trash bin. You can then look over the files to be sure you want to delete them, and make their removal permanent.
WP-Optimize
WP-Optimize offers many features related to cleaning and optimizing your website’s files. Specifically, you can set the plugin to automatically clean out ‘orphaned’ images or images set to certain sizes. Additionally, you can configure an optimization schedule that fits your website.
WPS Cleaner
WP Cleaner is a multi-function website cleaning plugin. However, it does have specific media-related features. For example, you’ll be able to review the total weight of your media files. Additionally, the user-friendly dashboard can help you identify unused media files and delete them in bulk or individually. WP Cleaner will also identify and include media added through any major page builder plugin.
How to manually clean up unused images in your WordPress Media Library
If you want to forego adding another plugin to your website, you have another option. You can clean up your WordPress Media Library manually.
Before doing so, it’s a good idea to back up your website.
You can also back up only your Media Library via File Transfer Protocol (FTP). Simply download the wp-content folder from your site’s server, and save it in a safe location (such as in cloud storage).
Once you’ve preserved your current website’s content, you can begin to clean out and delete the files in your library that you no longer need. This can be done by going to Media > Library in your dashboard.
If you choose to delete your files using the dashboard as described above, you’ll also want to double-check them using FTP. Depending on how they were added, some images may still be hanging around on your server, so it’s important to make sure they’re removed for good.
Delete unused images and build better WordPress sites with WP Engine
Much like a messy room, a cluttered Media Library probably isn’t very functional. Fortunately, we’re here to help you learn more about exceptional website management.
When you choose WP Engine to host your WordPress site, you gain access to top-notch developer tools and resources, and what’s more, our award-winning support team is always available to help! Find out more here, or chat with a representative.