

Dashboard — scan controls with format filters
s404 Orphaned Attachment Scanner helps you find and remove media files that are sitting in your WordPress Media Library but are not used anywhere in your installation — not in posts, pages, widgets, theme customizer, ACF fields, WooCommerce products, page-builder data, or any active plugin’s settings.
define('MEDIA_TRASH', true); in your wp-config.php to enable the media bin)s404as_is_attachment_used filter, s404as_before_delete / s404as_after_delete actions