Our WordPress media library is susceptible to filling up with unnecessary files, as we are constantly uploading files to test how they will look on our site. Another reason that can cause us to have a lot of unnecessary files is that we replace images due to changes in the style of our website.
Either way, you may want to remove hundreds of files from your media library and at this point, it is difficult for you to do so, as you have to find the files to remove from thousands of other files. And that will surely take hours and hours.
That’s why we want to show you how to remove hundreds of files from your media library using a spreadsheet that allows you to massively apply changes to thousands of files. Just follow a few simple steps.
1- Install the Media Library Spreadsheet plugin
This plugin allows you to apply massive editions to your files. It displays all your files on a spreadsheet where you can quickly edit the files.
Once installed and activated, go to Sheet Editor > Edit Media, and you’ll see the media spreadsheet with all your files.
2- Open the “Bulk Edit” tool
This tool will allow you to delete hundreds of images in just a few seconds. It’s located on the plugin’s toolbar, so just click on it.
3- Filter the files you’ll delete
We want to show you how easy it is to filter the files in order to delete them. You just need to select the I want to search rows to update option in the Select the rows that you want to update dropdown.
This will open a Search tool, and we want to show you these three options to filter your files.
To filter the files by date, you need to tick the Enable advanced filters checkbox and select these values.
- Field key: Format
- Operator: CONTAINS
- Value: image
Now you need to enter the dates in the Initial date and Final date fields. If it’s a specific day, enter the same date in both fields.
Finally, click on Run search and all your images uploaded on the selected date will be filtered.
4- Delete the filtered images
Once you have filtered your images, select these values in the Bulk Edit fields.
- Select the rows that you want to update: I want to select rows to update
- What field do you want to edit: Status
- Select type of edit: Set value
- Replace existing value with this value: Delete completely
- Click on Execute now
It’s that simple. You can delete thousands of files with just these simple steps.