| 开发者 | sandcircuit |
|---|---|
| 更新时间 | 2026年11月2日 13:49 |
| 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".
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.
No. MediaPrune loads only on its own admin screen, adds nothing to your site's front end, and makes no outside requests.
PHP must be able to write to the uploads folder directly, which is the case on most hosts.