👉
Support & questions
👉
Feature requests & bug reports
👉
Contact the developer
Mediaspy is the all-in-one media plugin for WordPress. It finds and deletes unused media, optimizes images, serves WebP and AVIF, allows safe SVG uploads, fixes broken media and keeps your media library healthy, every week, on its own.
Most media cleaners only check post content and delete images your site still uses. Mediaspy checks everything first: page builders, widgets, theme files, settings, code snippets and other plugins' tables. When it is not sure, it says so.
Clean unused media safely
- Find unused images and files – images, videos, audio, PDFs, archives and documents that no page, post, setting or theme uses
- Three honest results – Used, Unused and Uncertain. View Details shows every place a file is used
- Checks everything – post content, featured images, custom fields, ACF, page builders, widgets, Customizer, site logo and icon, theme files and theme.json, code snippets, user avatars, comments and other plugins' tables
- Every version of a file – resized sizes, the original behind a "-scaled" copy, edited copies, WebP/AVIF copies and CDN URLs
- Delete only what you select – download a ZIP backup first. Deleting is blocked when the site changed after the last scan
- Broken media – find pages and settings that point to files that no longer exist, regenerate missing sizes, remove orphan records
Optimize images and serve WebP/AVIF
- Compress JPEG, PNG and WebP on upload or in bulk. Auto quality picks the lowest quality that still looks the same, for each image
- WebP and AVIF for every image on your pages – Media Library images, CSS and page builder backgrounds, theme and plugin images and stylesheets. The original stays as a fallback for older browsers
- Works on every server – picture tags (no server setup, works with page caching), or Apache/LiteSpeed rules that are tested before they are kept. An nginx snippet is included
- Lazy loading for images, iframes and videos, missing width and height added, and the main image preloaded for a better LCP score
- Theme and plugin images – optimize the images that ship with your theme and plugins
- Safe originals – originals are backed up, one click restores them, and a before/after slider shows the difference
- Bulk optimize does used images first, retries failures, and skips animated GIF/WebP and CMYK images
Upload autopilot
- Clean file names – "Café Photo (1)_FINAL.JPG" becomes "cafe-photo-1-final.jpg"
- Remove photo location – GPS data is removed from phone photos without any quality loss
- Shrink huge uploads to a maximum size
- Safe SVG uploads – SVG files are cleaned with an allowlist: scripts, event handlers, external references and unsafe links are removed, the drawing is kept. SVGs get proper width and height in the Media Library
- Duplicate and large upload alerts – warn or block when a file is uploaded twice or is too big
Library tools
- Safe rename for SEO – rename "IMG_2041.jpg" to "red-leather-wallet.jpg": every size and copy is renamed and every page, setting and plugin table that uses it is updated. Preview first, undo for 30 days
- Replace media – upload a new version of a file and keep its URL, title and alt text. Undo for 30 days
- Duplicate images – find identical uploads and the same picture saved at another size or format. Keep one copy and every use moves to it, nothing is deleted
- Alt text – list images without alt text, edit them in place, or fill them from readable file names in one click
- Image sizes – see every size WordPress, your theme and plugins make, with disk use. Turn off sizes you do not need and clean leftover size files
- Files not in the Media Library – find files added by FTP or restored backups, then add them to the library or remove the unused ones
Media health and monitoring
- Media health score from 0 to 100, with a to-do list and a WordPress Dashboard widget
- Weekly background check – a scan and broken media check every week, in small steps, so the numbers stay current
- Opt-in emails – a weekly media report and an alert when media links break. Off until you turn them on
- Activity log – uploads, optimizations and scans in one place
Works with
Gutenberg and the Site Editor, Elementor, Divi, WPBakery, Oxygen, Bricks, Beaver Builder, Brizy, Kadence Blocks, GenerateBlocks, Spectra, Cornerstone, Thrive Architect, SiteOrigin, Avada/Fusion, ACF, WooCommerce, Slider Revolution, MetaSlider, Envira, Soliloquy, and the code snippet plugins FluentSnippets, WPCode and Code Snippets. Mediaspy matches images by URL (including every generated size), by file name and by attachment ID, so builders that store a resized copy or an ID-only shortcode are detected too.
For developers
WP-CLI commands:
wp mediaspy scan,
wp mediaspy duplicates,
wp mediaspy orphans,
wp mediaspy sizes and
wp mediaspy alt.
Light and private
Mediaspy runs on your own site. No account, no external service, no upsells and no request to Google Fonts. Scans run in small steps so large libraries never time out. Every screen can be translated.
1.4.1
- Passes the WordPress Plugin Check with no errors or warnings. No changes to features or settings.
1.4.0
Big update: Mediaspy now keeps your media library clean, fast and healthy, not just finds unused files.
Unused media scan:
- Rebuilt, much more accurate scan that never times out on large sites
- Results split into Used, Unused and Uncertain; View Details shows where each file is used
- Finds images in ACF fields, site logo and icon, avatars, comments, theme files, other plugins' tables, resized or edited copies and CDN URLs
-
Delete or download only the files you select; deleting is blocked if the site changed since the last scan
Image optimizer (new):
-
Compresses JPEG, PNG and WebP on upload or in bulk, picking the lowest quality that still looks the same
- Serves smaller WebP/AVIF versions of every image on your pages (Media Library, backgrounds, theme and plugin images), with the original as fallback
- Lazy loading for images, iframes and videos, and the main image is preloaded for a faster page
-
Originals are backed up and can be restored anytime; drag to compare before and after
Upload autopilot (new):
-
Clean file names, remove GPS location from photos, shrink huge uploads, sanitize SVG files
Library tools (new):
-
Safe rename and replace media, with every link on the site updated and a 30-day undo
- Find duplicate and look-alike images and merge them
-
Find files not in the Media Library and unused image sizes; fill missing alt text from file names
Health and monitoring (new):
-
Media health score, Dashboard widget and opt-in weekly email
-
Weekly automatic scan and broken media check, with an optional alert email
Admin:
-
Redesigned admin with one clear menu, now right below Media with the Mediaspy logo
- Works on phones and tablets, keyboard and screen-reader friendly, fully translatable
-
WP-CLI commands: scan, duplicates, orphans, sizes, alt
Fixed:
-
Download ZIP now contains only the selected files
- Mediaspy's own old scan data no longer counts as "in use"
- Dashboard storage and activity numbers now update correctly
1.3.1
- Fixed: the optional feedback box shown when deactivating the plugin did not appear (its script initialised before the modal markup was in the page). It now opens reliably on the Plugins screen.
1.3.0
Accuracy overhaul for page builders, plus new builder coverage and a deactivation feedback box.
New:
- Slider Revolution and MetaSlider support - images used only in Slider Revolution's own tables, or linked to a MetaSlider slideshow, now count as used instead of being flagged unused
- Brizy support - base64-encoded Brizy builder data is decoded so its images are detected
-
"View Details" now finds the same size-variant and ID references as the scan, so a used file is never shown as referenced nowhere
Fixed:
-
Images used at a specific size are no longer misreported as unused. The scanner now matches every generated size (e.g. image-768x512.jpg), not just the original file - this resolves false "unused" results with Oxygen's "choose a size" workflow and any page builder that stores a resized URL
- Builders that reference an image by ID inside a shortcode are now detected - WPBakery (image="ID", images="1,2,3"), Divi galleries (gallery_ids) and Avada/Fusion (image_id)
-
Oxygen 4 (ct_builder_json) double slash-escaped URLs are now matched
Compatibility:
-
Tested up to WordPress 7.1
Internal:
-
Detection rules moved into a dedicated, unit-tested UsageDetector shared by the scan and the usage lookup
1.2.0
- New: Upload Guard - duplicate detection at upload time (filesize prematch + md5 of original bytes, so scaled/rotated images are matched correctly)
- New: Upload Guard oversize alerts with off / warn / block modes and separate image vs other-file size limits
- New: Upload Guard missing-alt attention list with inline editing
- New: resumable library hashing backfill so duplicate detection covers files uploaded before the guard existed; the same pass flags existing images missing alt text
- Note: programmatic uploads (cron, WP-CLI, sideloads/importers) are logged, never blocked
- New: Foreign Media Resolver - foreign_domain references are now actionable
- New: Localize - download an externally-hosted image into your Media Library and rewrite every reference (post content, custom fields, options, term meta) to the new local URL, serialization-safe
- New: Remove reference - safely clear a dead external link from its stored data
- New: exposure signal (Live vs Stored) so you can tell a real front-end dependency from leftover orphan data
- New: extra_local_domains setting to treat a CDN / migrated domain as local
- Security: SSRF-guarded downloads (private/loopback/link-local IPs blocked, image MIME sniff, size cap, SVG opt-in)
1.1.0
- New: Broken Media Detector - finds references to files that no longer exist
- New: classifies broken references (deleted, missing size, ghost attachment, foreign domain)
- New: one-click thumbnail regeneration for missing image sizes
- New: ghost attachment cleanup for media records whose file is gone
- New: optional extra local domains setting for CDN / migrated URLs
- Internal: Scanner corpus refactored into a single shared indexed pass (no change to unused-scan results)
1.0.1
- Refactor: rebuilt on a modular MVC structure with PSR-4 services and Composer autoloading
- New admin interface built with Vue 3 and bundled with Vite
- Scan, delete, usage details, export and import now run over the REST API (replacing admin-ajax)
- Security: hardened the ZIP import - reject path-traversal entries (Zip-Slip), extract outside the web root, and cap archive size and file count against decompression bombs
- Security: removed an over-eager import de-duplication step that could delete unrelated media sharing the same filename
- Added uninstall cleanup (removes the cached scan, transients and temporary export/import folders)
- Refreshed the header branding with the Mediaspy logo
- Source files normalised to ASCII (fixes garbled comment characters)
- No change to detection accuracy or everyday workflow
1.0.0
- Initial release
- Full media library scan with 6-layer usage detection
- Grid and list view with search, filters, and sorting
- Bulk delete, Download ZIP, and Import ZIP
- View Details modal showing every usage location per file
- Live two-way sync with the WordPress Media Library