WordPress – Delete Thousands of Images in Media Library

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.

Video Guide

Text Guide

In this tutorial, 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.

You can download the plugin here:

Download Media Library Spreadsheet Plugin - or - Check the features

Once installed and activated, go to Sheet Editor > Edit Media, and you’ll see the media spreadsheet with all your files.

wordpress-delete-thousands-images-media-library

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.

wordpress-delete-thousands-images-media-library

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.

wordpress-delete-thousands-images-media-library

This will open a Search tool, and we want to show you these three options to filter your files.

a) Delete files by keyword

For this, you need to enter a specific keyword in the Contains keyword field.

wordpress-delete-thousands-images-media-library

Then, tick the Enable advanced filters checkbox and use these values.

  • Field key: Format
  • Operator: CONTAINS
  • Value: image

Now, just click on Run search and the plugin will filter all the images containing the selected keyword.

b) Delete files by date

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.

wordpress-delete-thousands-images-media-library

Finally, click on Run search and all your images uploaded on the selected date will be filtered.

c) Delete files by extension

You can delete all the .png or all the .jpeg images. For that, just tick the Enable advanced filters and select these values:

wordpress-delete-thousands-images-media-library

  • Field key: Format
  • Operator: CONTAINS
  • Value: “jpeg” or “png”

Finally, click on Run search and your images will be filtered.

4- Delete the filtered images

Once you have filtered your images, select these values in the Bulk Edit fields.

wordpress-delete-thousands-images-media-library

  • 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

Done!

It’s that simple. You can delete thousands of files with just these simple steps.

You can download the plugin here:

Download Media Library Spreadsheet Plugin - or - Check the features

Do you need help?

You can receive instant help in the live chat during business hours, or you can contact us and we will help you via email.