Note: Since publishing, some folks have left a few caveats in the comments. I’d recommend you read them before you go deleting things.
If you’ve had your WordPress website for more than a little while, there’s a good chance your media library contains images that aren’t being used – as you delete pages or posts from your site, these unused images get orphaned and serve no purpose other than to take up space on your web hosting account.
Even if you have a web hosting plan with plenty of space, these unused files will increase the size of your backups and can get in the way as you sort through your uploads and media library to find what you need.
How to Find (and Remove) Unused Images in WordPress
WordPress lets you easily find unused photos in the media library (no plugin is required – so this will work with either self-hosted WordPress, or if you use WordPress.com). Here’s how:
- Log into your WordPress admin dashboard.
- From the menu, go to Media → Library
- At the top of the screen you’ll see the search/filter bar and it probably looks like this:
- Change the first dropdown to show “Unattached”
- The grid showing images will now only show those that aren’t being used by any pages or posts on your WordPress site. You’re free to delete these, or keep them around if you think you might need them in the future. NOTE: Just because WordPress doesn’t think the image is being used in a Page or Post doesn’t mean you might not have used it somewhere else on the website, such as in your header, in a widget, etc. Delete only if you see images that you know aren’t being used.
I’m a fan of reviewing things to ensure I don’t delete something inadvertently. That said, it’s never a bad idea to back up your WordPress site before starting to do this cleanup.
As photographers, we probably have a ton of images in our media library as it showcases our work and informs our clients of what to expect. Don’t skimp on including images on your website because you’re concerned about disk space, but rather include several images with each blog post or page. What I’ve described above is simply occasional maintenance you can perform to find the unused images in WordPress for cleanup.
How to find unused images taking up space in your WordPress media library: https://t.co/0FqlrTUYEv
— Photowebo (@photowebo) December 5, 2016