Media files (images) are necessary additions on any website. However, it’s easy for your WordPress Media Library to become bloated and full of unused images, which can use up your disk quota and slow down your wordpress admin and make media management difficult.
Fortunately, managing your Media Library does not need to be a chore. By performing regular housekeeping and optimizing your images appropriately, you can be sure your website (and its media contents) are operating at their best.
In this post, we will show you several ways to clean up your WordPress Media Library. We’ll then introduce three plugins that can make the process easier with bulk automation. Let’s get started!
Table of Contents
- Why You Should Clean Up the WordPress Media Library
- Reduce The Amount of Used Storage
- Resize Images
- Use JPG Images Instead of PNG
- Eliminate Duplicate Images
- Delete Unused Files and Images
- Plugins For Image Cleanup
- How to Manually Clean Up the WordPress Media Library
- Excel with WP Engine
Why You Should Clean Up the 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 web 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 web hosting plan, all those extra files could eventually cost you more each month, in addition to creating an overall slowdown. Still, it’s important to make at least one copy of your current website before tackling a Media Library cleanout. This is because most cleanout processes mean you’ll be 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 functionality.
For example, the more files that are uploaded to a website, the longer it will take to load. This can slow down site speeds, and may drive visitors away. It can also interfere with the site’s User Experience (UX).
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 back ends.
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.
Use the correct image type
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 on more complex images such as photos.
When comparing JPG and PNG images side by side, you’ll notice a big difference in quality and size depending on what type of image it is. PNGs are higher quality and are best suited to simple images such as logos, illustrations, cartoons etc or when you need transparency.
JPG is better for complex images such as photos, where there is a lot of detail and colour, because the lossy compression makes the image much smaller, which results in loss of detail, but this is usually not noticeable on such images.
Use the correct image type to get the best image size and quality. Sometimes a compromise might be required.
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 fill up your available storage space, while also slowing your website down.
Fortunately, this is something you can easily put a stop to. To do so, 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 Files and Images
One of the easiest ways to unload 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).
Plugins For 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 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 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.
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 the 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. This can be done with a plugin such as BackUpWordPress.
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. To delete a single image, click on it and then choose the Delete Permanently option at the bottom of the screen.
A popup will appear, and clicking on 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 media. From the Media Library page, click on Bulk Select at the top.
Click on all the files you’d like to delete, and choose Delete Selected. Then select OK to permanently remove those 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 (although the more frequently you complete it, the better).
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.