Skip to content
Sign in
Unused Media Usage Audit by CodeCaste icon

Unused Media Usage Audit by CodeCaste

Find potentially unused Media Library files and safely review them before deletion.

Not scanned yet WordPress plugin

Install in

No install steps yet

Follow the steps on the source page.

The plugin scans WordPress data, builds a reference index, and lists attachments for which no supported reference was found.

Supported sources include:
* Post content, blocks, shortcodes, lazy-load data, and srcset
* Post meta, custom fields, ACF, and SCF data
* Elementor data
* WooCommerce product images and galleries
* Options, widgets, term meta, and user meta
* Active/parent theme PHP, CSS, JavaScript, HTML, and JSON files
* Eligible custom database tables
* Developer-registered custom scanners

Dashboard: Tools -> Unused Media

Safety

  • No automatic deletion.
  • Results are Potentially Unused, not guaranteed unused.
  • A final reference check runs before deletion.
  • Full scans run in background batches.
  • Targeted re-scans can run after site changes.

How It Works

After activation, a background scan starts automatically. The plugin indexes detected references and classifies attachments as In Use or Potentially Unused.

The dashboard shows scan status, logs, scan time, and results. Use Run Full Scan for a complete rescan.

If WP-Cron is unreliable, configure server cron for wp-cron.php or keep the dashboard open during scanning.

Results

The dashboard includes search, filtering, list/grid views, attachment details, and Media Library links.

You can delete individual files, selected files, or all files matching the current filters.

WordPress’s standard attachment deletion API is used.

Limitations

Detection is not guaranteed for:
* Dynamically generated URLs
* External APIs or remote services
* Some CDN/offloaded media
* Plugin source files and unsupported filesystem locations
* Unsupported custom database formats
* Some numeric attachment IDs
* WordPress Multisite, which is not currently verified

Always review files before deleting them, especially on sites using CDNs, offloaded media, or third-party integrations.

Developer Extension

Developers can add custom scanners using the
media_cleanup_scout_additional_reference_sources filter.

Data

The plugin stores its scan index, results, logs, settings, and scan state in plugin-managed data.

Deactivation clears scan data and scheduled jobs. Uninstalling removes plugin-managed data and settings.

Written by Joobi from the project's own listing. See the source page

auditcleanupimagesmediaunused media
23 Nov 2026
Version 1.3.4 released. Not scanned yet.

1.3.4

  • Clearer delete failure messages in the dashboard.
  • More precise live reference checks to reduce false blocks from image optimizer meta (e.g. Smush).
  • Safer matching for attachment IDs and file URLs in post content.

1.3.2

  • Scan theme HTML and JSON files for media references (block themes / theme.json).
  • Delete physical theme asset files when removing theme-based attachments so they do not reappear after rescan.

1.3.1

  • Updated plugin URI, version, and documentation.

1.3.0

  • Rebranded to Unused Media Usage Audit by CodeCaste.
  • Updated slug/text domain and internal prefixes.
  • Fresh scan/settings state after upgrade.

1.2.3

  • Improved WordPress.org compliance and settings migration.
  • Moved dashboard to Tools -> Unused Media.

1.2.2

  • Added scan-recency and WP-Cron notices.
  • Added WooCommerce gallery change detection.

1.2.0

  • Improved security, performance, concurrency, and scan coverage.
  • Added custom scanner support and cleanup improvements.

1.1.0

  • Initial public release.
24 Sep 2026Listed on Joobi from WordPress.org.

Follow this listing's changes (Atom feed)