Clean up the WordPress Media Library
If your WordPress Media Library becomes very large, it can take up a lot of disk space and slow down your website. That's why we recommended cleaning it regularly.
In this guide, we show you how to clean up unused media files manually and with a plugin, and give you tips on how to keep the Media Library from growing too big.
- What is the WordPress Media Library?
- Why clean up the WordPress Media Library?
- How to delete unused files manually
- Use a plugin to clean up the Media Library
- How to avoid a large Media Library
Don't have a website yet?
With WordPress, you can easily and quickly build the website of your dreams.
What is the WordPress Media Library?
The WordPress Media Library is a catalogue of all the media files that you have uploaded to your website, such as images, audio and video files and documents. You can find the Media Library in your WordPress dashboard.
- Log into your WP Admin.
- Click Media in the menu on the left and select Library.
Why clean up the WordPress Media Library?
The size of your WordPress Media Library will increase over time because unused images are not automatically deleted. WordPress also duplicates uploaded images into different sizes by default.
A large Media Library takes up unnecessary disk space, increases backup sizes, complicates media management and slows down your website. If your website has been up and running for some time, it's likely that the Media Library contains images which are not actually used on your website.
How to delete unused files manually
If your Media Library doesn't contain too many files, you can remove unused images manually. You can either delete images one-by-one or bulk-remove multiple images in one go.
Note: This action cannot be undone. Before you continue, we recommend that you make a backup of your site. Check out our guides below if you're unsure how to do this.
- In WP Admin, click Media in the menu on the left and select Library.
- Select the image you want to delete.
- In the pop-up window, you can see the details of the image. Choose Delete Permanently in the bottom-right corner.
- Click OK to confirm that you want to permanently delete the file.
Tip: You can also bulk-delete files and images. Simply click the button Bulk Select in the Media Library, choose all files you would like to delete, and click "Delete Selected".
Use a plugin to clean up the Media Library
If you have a large Media Library, it can be time-consuming to clean it up manually. Luckily, there are plugins that can help you.
We recommend using the plugin Media Cleaner to clean up your Media Library. Media Cleaner is a free plugin which scans your WordPress Media Library and looks for files that are broken or not used on your website.
Note: Any media files removed by the plugin will be permanently deleted. Before you continue, we recommend you make a backup of your site. Check out our guides below if you're unsure how to do this.
- Go to the Plugins page in WP Admin.
- Search for media cleaner, and install and activate the plugin called "Media Cleaner - Clean & Optimize Space".
- Select Cleaner under Meow Apps in the menu on the left.
- Click "Access Media Cleaner Dashboard", scroll down and click Scan.
- Select the files that you want to remove and click Delete.
Tip: You can also click on the Delete All button to remove all unwanted media files in one go.
How to avoid a large media library
There are several preventive actions you can use to keep your media library from growing too big. We have collected some tips for you.
Optimise your images
The primary goal of optimising images is to find the balance between the smallest file size and an acceptable quality. Optimising images has many benefits, such as making your website load faster, improved SEO rankings, using less disk space and faster website backups.
Compress images before uploading
Image compression is the main way you can reduce image size.
Before you upload images to the media library, you can compress them in an image editing tool such as Adobe Photoshop or GIMP. There are also other tools online which you can use.
Don't want to manually compress your images before uploading them? Use the free plugin Imagify to optimise all images. It's included in all 1-click WordPress installations by default.
Upload smaller images
Another important way to optimise images is scaling.
Images directly uploaded from smartphones or cameras are usually high-quality images with huge file sizes, and they are not optimised for the web. Usually, these huge images are not shown in their original size on the website but are instead downsized with HTML or CSS, but the visitor's browser still downloads the full-size image in its original size.
To avoid this, we recommend that you upload smaller images to the media library, so that the image's size matches the actual pixel dimensions you use to display it on your website. which means a reduction in file size.
Regular checkups
We recommend regularly checking and cleaning up your WordPress media library to keep it from accumulating in size. Doing this on a monthly basis is a good idea, but the more often you do it the better.
Use JPG format rather than PNG
Two of the most common image formats are JPG and PNG. JPG files are better for photography, while PNG is used for graphs and images with text or transparent parts, such as logos.
PNG files are often higher in quality, but that also means a larger file size. We recommend using JPG files for images on your website, because big images make your website slower and harm its user experience.
Related articles: