Media Library Scanner
A WordPress plugin that scans the Media Library and identifies used and unused media assets across posts, pages, custom fields, and page builders.
by Mangesh Jaiswal · github.com/mangesh292/media-library-scanner · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/mangesh292/media-library-scanner/archive/refs/heads/main.zipReadme
Media Library Scanner
A WordPress plugin that scans the Media Library and identifies used and unused media assets across posts, pages, custom fields, options, WooCommerce galleries, and the Elementor page builder. It takes a ZIP backup of the real files before any permanent delete.
Install
Install the ZIP via Plugins → Add New → Upload, activate, then open Media → Media Library Scanner.
Requirements
- WordPress 5.8+
- PHP 8.0+
Project structure
media-library-scanner.php Plugin header, constants, autoloader, bootstrap
uninstall.php Removes the backup folder on uninstall
readme.txt WordPress.org readme
includes/
class-plugin.php Shared config + hook wiring
class-admin-page.php Menu, asset enqueue, template render
class-ajax-controller.php scan / export / delete / download endpoints
class-media-query.php Attachment listing + search SQL
class-usage-detector.php Core "is it used, and where?" logic
class-elementor-detector.php Elementor-specific detection
class-zip-exporter.php ZIP backup + secure download
templates/
admin-page.php Admin page markup
assets/
css/scanner.css Styles
js/scanner.js Front-end behavior
Warning
Usage detection is best-effort and cannot cover every theme/plugin. Always keep an independent backup before deleting.