Unused images: find and delete pictures nothing uses

Unused images finds pictures in your media library that nothing on the site uses, shows them with a preview and size, and deletes the ones you choose. It frees disk space and tidies the library. It is a Pro tool, included in the Pro, Plus and Agency plans: it needs a licence that includes it, and without one the tab shows a Pro notice. Open it in Baza Helper > Unused images, in the Content group.

Before you start

  • Make a backup. Deleted pictures cannot be brought back.
  • Keep the tab open while the scan runs.

Scan the library

  1. Open Baza Helper > Unused images.
  2. Press Scan the media library.
  3. Wait for the progress bar. The scan reads pages and posts, custom fields, settings and widgets, category and tag fields and user fields, then checks the media library.
  4. When it ends, a pop-up says how many unused pictures were found and their size. The scan only reads. It deletes nothing.

A picture counts as used when its ID or its file is named anywhere in that data. Pages and posts of every status count, drafts and trash included, but revisions and auto-drafts do not. Custom fields count as well: a single ID, a list of IDs such as the WooCommerce product gallery, serialized data and page builder data such as Elementor. Gutenberg blocks (image, gallery, cover, media and text) count, and so do shortcodes: , Divi gallery_ids and WPBakery image and images. Settings and widgets count too, for example the site icon, the logo and theme settings. Files are matched by their path in the uploads folder, so photo-300×200.jpg and photo-scaled.jpg count as use of photo.jpg, and a picture used in any size counts as used. With Polylang or WPML, a picture whose translation in another language is used counts as used.

Read the result

The list shows a thumbnail, title, file name, total size (the original plus every size WordPress made) and upload date, with a link that opens the picture in the library. The largest pictures come first, and the list holds up to 2000 pictures. Pictures uploaded in the last 14 days are left out, because they may be about to be used. Only images are listed, not PDFs or videos.

Delete pictures

  1. Look at each preview, or tick Select all.
  2. Press Delete selected (N) and confirm in the dialog.
  3. The pictures are deleted for good, with the file, every size and the library record. Deleting runs in batches of 25.
  4. A short notice tells you how many were deleted and how many could not be.

Only pictures from the latest scan can be deleted. Scan again after a big change in the content.

What the scan cannot see

  • A picture that only a theme file or plugin file names in its PHP, CSS or JavaScript code.
  • A picture used through a link on another website.
  • A picture referenced only by a path outside the uploads folder.

Check the preview before you delete, and keep a backup.

Questions

  • Why is my picture listed? Nothing in the scanned data names it. It may be used only in theme code or on another site.
  • Why is my picture not listed? It is used somewhere, it is newer than 14 days, or it is not an image.
  • Can I undo a deletion? No. Restore it from a backup.
  • Does it work with a CDN? CDN links that contain the uploads path are recognised, and multisite folders are handled. A picture kept at another address outside the uploads folder is not seen.
  • How long does it take? It runs in small steps. A large database means many steps, so leave the tab open.

For developers

The filter baza_helper_unused_images_grace_days changes how many days a new upload is left alone. The default is 14.

Last Modified: 19.10.2026