| 开发者 | sandcircuit |
|---|---|
| 更新时间 | 2026年11月23日 00:21 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
third-party-licenses.txt.
Install MediaPrune, go to Media → MediaPrune and run a scan. It lists every image and file nothing on your site uses. Review the list, then move the files to quarantine. They're deleted for good after 30 days, or straight away if you choose "Delete now".
WordPress doesn't show which files in your media library are unused. MediaPrune scans your posts, pages, custom fields and site settings, then lists every image, video, PDF and other file nothing refers to, with its size and upload date. Go to Media → MediaPrune and click "Scan media library".
MediaPrune checks your posts, pages, custom fields and site settings, and keeps any file it isn't sure about. It can't see files referenced from outside the database, such as an image hard-coded in a theme's CSS or PHP, or linked from another website. That's why cleaned files go to quarantine first: look over your site after cleaning, and restore anything that's missing.
Developers can mark such files as used with the mediaprune_used_attachment_ids filter.
Yes. MediaPrune reads custom fields, which is where WooCommerce stores product galleries and where ACF and page builders store images, so files used there are kept.
Yes. Files are matched by their path, so CDN URLs, resized copies, -scaled originals and WebP versions all count as uses of the original file.
Yes. It removes each file from the server along with every resized copy, not just the media library entry. The review screen shows how much space your selection will free.
Into a folder inside your uploads directory, named mediaprune-quarantine- plus a random suffix, protected by an index.php and an .htaccess file that blocks web access. While a file is in quarantine, it's hidden from the media library.
It doesn't touch your site's front end, and its scanning only runs on its own admin screen. Nothing leaves your site unless you allow it: MediaPrune asks once, and until an administrator clicks Allow it makes no outside requests. If you do allow it, it sends anonymous usage data to SandCircuit's own server (telemetry.sandcircuit.com): a random install ID, the MediaPrune, PHP, WordPress and database versions, and the site language. It never sends your site's address, names, email addresses, file names or media. Your IP address is used only to work out your country and is not stored. You can stop sharing at any time, which also deletes the data held for your site. After you click Allow you are also asked once, separately, whether you want product news, which would share your name, email address and the site's address. That is optional and off unless you say yes, and you can switch it off again separately. When you deactivate MediaPrune you may be asked why; answering is optional and the answer is not linked to your site. See the privacy policy.
PHP must be able to write to the uploads folder directly, which is the case on most hosts.