Think of your WordPress media library like a closet in your house. Over time, you keep adding more and more stuff to it – pictures, videos, documents, etc. Eventually, it gets so full that finding what you need is a chore.
So, how do you clean up your media library? You can do it manually by going through each file and deleting what you don’t need, or you can use a plugin to help you do it faster and easier. In this article, we will cover it and give you extra tips to avoid the enormous WordPress media library.
How to clean up your WordPress media library
You can do it manually or use a plugin. Take note that you should prepare a backup version of your WordPress site in case you accidentally delete the wrong files.
Manually through WordPress dashboard
Follow these steps to have a tidy media library
Open your WordPress dashboard
- In the left-hand menu, click on “Media -> Library”. Here, you’ll see all the files you’ve uploaded to your site.
- Click on the “List View” icon at the top left of the Media Library. This view allows you to see more details about each file, including its upload date and any attached posts.
- Use the filters and search bar to find specific files. You can filter by date or media type to narrow down your search.
- Look for files that are not attached to any posts or pages. These are often safe to delete.
- Select the files you want to delete by clicking the checkbox next to each file. Then click “Bulk Actions,” select “Delete Permanently,” and click “Apply.”
- A confirmation message will appear. Confirm that you want to permanently delete the selected files.
Using Plugins
There are several plugins designed to help you clean up your media library. We suggest the most common which is media cleaner
Here’s how you use media cleaner:
Why is cleaning up the WordPress media library an important job?
When you have too many unnecessary or old files stored in your media library, it can cause problems for your server. Each file you upload takes up space on your server. If you let these files pile up, you could run out of storage space.
How to optimise media library
To avoid the media library becoming a mess, you should keep in mind these tips below to optimise the files you are adding to the library.
Prefer the usage of JPG format over PNG
For the majority of images on your website, using the JPG (or JPEG) format is recommended over PNG. JPG uses lossy compression to significantly reduce the file size of images without noticeably degrading their visual quality. This means that JPG images take up less storage space on your server, and for the end-user visiting your website the site will feel faster.
However, there are some exceptions where PNG is the more suitable choice:
1. Images with few colors: If your image consists of only a small number of distinct colors, such as simple graphics, logos, or illustrations, PNG can achieve smaller file sizes than JPG.
2. Transparency: When you need to preserve transparency in your images, such as logos or graphics that overlay other elements. PNG supports transparency while JPG does not.
3. Sharp edges and text: For images that contain crisp edges, fine lines, or small text, PNG maintains sharpness better than JPG. JPG’s lossy compression can introduce artifacts and blur around sharp edges, making them appear fuzzy or distorted. In this case though you should also consider using standard text in HTML or an SVG.
In summary, while JPG is the go-to format for most images due to its excellent compression and faster loading times, PNG is the better choice when dealing with images that have few colors, require transparency, or contain sharp edges and text. Consider the specific requirements of each image and choose the format that balances file size and quality to optimize your website’s performance.
Compress your images beforehand
Before uploading images on your website, use tools like TinyPNG to shrink their size without making them look worse. Ideally, the image size is between 40~120kb.
Use reasonably sized images
Think of image sizes like picture frames. Small images are like small frames; they fit better on your webpage and load faster. For example, thumbnails can be as small as 150×150 pixels, and banner images can be around 800 to 1200 pixels wide. Avoid using huge images because they take longer to load, especially on phones or slow internet. You can use a tool like IloveIMG for cropping and resizing.
Conclusion
When you tidy up your WordPress Media Library, it keeps your website running smoothly. Your site requires less storage space which can keep your hosting costs in check, and can make other daily processes such as malware scanning or backups run more efficiently.