Today we are going to explore an area of the WordPress Media Library that often confuses beginner users - how to properly and permanently delete a media file. Every website powered by WordPress has its own Media Library. This library of media files (which can include images, video, audio, etc.) can be located in the Media item on the sidebar menu of your WordPress website’s dashboard admin area. Any time you add a media file to a post, page or elsewhere on your site, it will automatically be added to your site's Media Library. It's important to understand where images and other media files are stored once they are added to your website so that you can correctly remove them if/when the time comes.
Cleaning the Media Library
Since every media file you add to your WP website automatically gets added to the Media Library, the size of the library can grow very quickly. Odds are you won't want to delete any images that are currently being used on pages or posts on your website, but you may want to tidy up any unused images / media files. Not only will this clear up room on your WP server, it will also make it easier to navigate around the Media Library.
Unattached Media Library Files
Within the Media Library, it's easy to see a list of all the media files that are not currently being inserted / used in a page or post on your site. From the Library section in the Media tab, select Unattached from the drop down menu to display all files that are not currently attached somewhere on your website (see image below)
These files are usually unattached for two reasons:
- they were either uploaded directly into the media library (as opposed to being inserted into a post / page first)
- or, they are files that were added into a post/page, but that content has since been deleted or updated
To completely and permanently remove a media file from WordPress, it must be deleted from it's original instance in the Media Library. To do this, click Bulk Select > check off the images you wish to delete > click the blue Delete Selected button.
Note: Deleting a media file from the body of a page or post on your site will simply removed it from that instance of the content. It does not permanently delete the original file from WordPress. For a permanent delete, you must follow the instructions above.
Have you ever had to remove media files from your website's WP library? Did you use the bulk-delete function or remove them individually as needed? Let us know in the comments!