Description
👉 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.
Privacy and external services
Mediaspy runs entirely on your own site and does not phone home during normal use.
The only outbound request is optional deactivation feedback: if you click “Submit & Deactivate” in the feedback box shown when deactivating the plugin, your selected reason, your optional message, your site URL, and your plugin/WordPress/PHP versions are sent to the developer’s feedback endpoint. Clicking “Skip & Deactivate” sends nothing.
Installation
- Go to Plugins › Add New in your WordPress admin
- Search for Mediaspy
- Click Install Now, then Activate
- Open Mediaspy in the admin menu (right below Media) and click Scan library
Manual install
- Download the ZIP file
- Go to Plugins › Add New › Upload Plugin
- Upload the ZIP, click Install Now, then Activate
- Open Mediaspy in the admin menu and click Scan library
FAQ
Is it safe to delete unused images?
Mediaspy checks every file against your whole database and your theme files before calling it unused, and files it is not sure about are marked Uncertain and never deleted in bulk. Still, take a site backup before deleting many files, and use Download to save a ZIP of the files first. Deleting is permanent.
What if a file shows unused but I can see it on my site?
If a plugin builds an image address in code at runtime, no scanner can see it. If you see a file on your site, do not delete it, and open View Details: it shows every place the scan found the file.
What does “Uncertain” mean?
The file is not used by live content, but a post in the Trash uses it, or its name appears in data Mediaspy could not fully read (a very large or damaged setting). Mediaspy never deletes Uncertain files in bulk.
Why can I not delete right after editing a page?
Deleting uses your last scan. When posts, widgets or theme settings change after the scan, a file that was unused may now be used, so Mediaspy asks you to scan again first.
Does it work with Elementor, Divi, Oxygen and other page builders?
Yes. Mediaspy reads the data builders store in post meta, options and their own tables, including JSON-escaped and base64 data, and background images set in the Site Editor.
Does Mediaspy make my site faster?
Yes, for images, which are usually the heaviest part of a page. It compresses images, serves smaller WebP/AVIF versions, lazy loads images, iframes and videos, and preloads the main image. It does not cache pages or minify JavaScript and CSS, so it works next to your caching plugin.
How are WebP and AVIF served?
Copies are saved next to the original with the new extension added: photo.jpg gets photo.jpg.webp and photo.jpg.avif. The original is never replaced, so every link keeps working, and a copy is only kept when it is smaller. In Settings › Optimization choose:
- Picture tags (recommended) – images are wrapped in a picture tag that lists AVIF, then WebP, then the original. Works on every server and with page caching
- Server rules (Apache, LiteSpeed) – rules in wp-content/uploads/.htaccess, tested with a real request before they are kept. If the server ignores them, picture tags are used instead
- Off – copies are made but not served
Background images and theme and plugin images have their own switches in the same section. On nginx, the Optimize screen shows a snippet for your server configuration.
Can I undo optimization?
Yes. With “Keep originals” on (Settings › Optimization), each original is saved in a private folder before it is changed. Restore puts it back and removes the WebP and AVIF copies.
Is SVG upload safe?
SVG uploads are off until you turn them on in Settings › Uploads. Then every SVG is cleaned with an allowlist before it is saved: scripts, event handlers, external references and unsafe links are removed, and only known drawing elements are kept.
Does Mediaspy change my files?
Only new uploads, and only for the autopilot options you leave on: clean file names, removing photo location and shrinking huge uploads. Files already in your library change only when you optimize, rename or replace them yourself.
Is renaming a file safe?
Mediaspy uses your last scan to find every place the file is used and updates saved data without breaking it (serialized and JSON data are rebuilt, not search-and-replaced). A preview shows each place first, places it cannot update are listed, and you can undo for 30 days. If you use a page cache, clear it after renaming.
I replaced an image but still see the old one. Why?
With “Keep the file name and URL” the address does not change, so your browser, a page cache or a CDN may show the old copy until its cache expires. Clear your cache.
How does Mediaspy find duplicate images?
It compares the exact contents of each file, and also finds the same picture saved at another size, quality or format. The same product in another colour, crops and rotated copies are not grouped. Merging never deletes anything and can be undone.
Will turning an image size off break my site?
It only stops WordPress making that size for new uploads; existing files are not touched. A theme that asks for a size that is off gets the full-size image instead, so only turn off sizes your theme and plugins do not use.
Does Mediaspy scan on its own?
Yes, once a week in the background, in small steps a minute apart, so visitors never wait. Turn it off in Settings › Reports & monitoring.
Does Mediaspy send emails?
Only if you turn on the weekly report or the broken media alert. Every email has a link to turn it off.
What happens to my images when I delete Mediaspy?
Optimized images stay as they are. WebP and AVIF copies are deleted, because only Mediaspy serves them. The backups of your originals (the uploads/mspy-backups-… folder) are kept so you can reinstall and restore them; delete that folder yourself if you do not need it.
Does it support Multisite?
Not yet. Mediaspy is designed for single sites.
Screenshots









Changelog
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-768×512.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
