| 开发者 | alidadeeditions |
|---|---|
| 更新时间 | 2026年11月25日 23:41 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
intermediate_image_sizes_advanced filter) are never made again.photo-300x200.jpg, next to their image, are ever considered. Originals, current sizes, edit backups and files of other media items are never touched.wp thumbwright regenerate, wp thumbwright cleanup (makes the dry run; --yes then deletes what it listed), wp thumbwright resume and wp thumbwright cancel. Ctrl-C stops after the current image where PHP has the pcntl extension (without it, Ctrl-C stops in the middle of an image, and resume first waits up to 5 minutes for the stopped run's lock to expire); reports can be saved with --format=csv > report.csv. They sit beside wp media regenerate and do not replace it.No. Rebuilding never deletes anything, and the clean-up never considers the original upload, the main file, current sizes or edit backups. It only lists files named like a size of the image (photo-300x200.jpg), and only deletes them after you have read the dry run and confirmed.
Before listing a file, the clean-up searches the WordPress tables for its name: posts, menu item labels, custom fields, options, comments, category descriptions, and term, user and comment meta. The old Link Manager (hidden since WordPress 3.5) is not searched. If it is found, the file is kept. Old post revisions are not searched (on most sites they would keep nearly every file): if you restore an old revision, check its images. Tables created by other plugins (sliders such as Slider Revolution, SEO caches) are not searched; such plugins can use the thumbwright_file_in_use filter. We still recommend a backup of the uploads folder before deleting.
Yes for content stored in the WordPress tables, including the raw HTML and code blocks of WPBakery and Avada, which are stored encoded. Not covered: tables of their own (for example Slider Revolution's slides), pages stored in files, and themes that build image file names on the fly in their code. For those, use the thumbwright_file_in_use filter, read the dry run carefully, and keep a backup.
Yes, in one case: a file named like an image size (banner-1600x300.jpg) that is not a media item and is only referenced from a theme or plugin file (CSS, PHP). Such references cannot be detected. Read the dry-run report before deleting, and keep a backup.
They are rebuilt from the edited version (crop, rotation, scale). Sizes you set apart in the image editor ("thumbnail only", "all sizes except thumbnail") are kept as they are and reported. A restored image is rebuilt from its original upload.
Copies named like the size with another extension (photo-300x200.webp) are kept as long as their size is in use, and listed with it once it is old. Copies with a double extension (photo-300x200.jpg.webp), and the copies of the Modern Image Formats plugin (photo-300x200-jpg.webp), are never touched, even when their size is old: remove them with the plugin that made them.
When an old JPEG has exactly the same dimensions as a new WebP size, it looks like a copy made by an optimisation plugin, so it is kept to be safe. Remove such files by hand after checking your pages.
Nothing is lost: resume the task. Then lower "Images per step" in the settings, or raise "Memory for image work" (for example 512M) if your host allows it.
In wp-content/uploads/thumbwright-trash/, one folder per clean-up, with the same sub-folders as your uploads. The folder holds an .htaccess file that closes it to visitors on Apache and LiteSpeed; on Nginx, image files there can still be opened by someone who knows their exact address, as they could before the clean-up. Deleting the plugin (not just turning it off) deletes the trash for good.
When the files leave the trash: 30 days after the clean-up, or as soon as you choose "Delete for good" on the Trash tab. Turn the trash off in the settings to free the space at once.
Yes, if you use a page cache (caching plugin, host cache, Cloudflare). Cached pages may still show the old image files until the cache is cleared.
Thumbwright follows that filter when rebuilding, but the clean-up only knows sizes registered with add_image_size(). Files of a size added by the filter alone are listed as a size "no longer registered" (the dry run names it): leave them out by not deleting, or register the size with add_image_size().
Only with files present in the uploads folder of your server. Images offloaded to external storage are not supported in this version.
Yes, site by site: open Tools > Image Sizes on each site, or use --url= with WP-CLI (there is no --network option). The check for files used in content only looks at the current site: if one site shows an image from another site's uploads, keep a backup before deleting.
Administrators only (the manage_options capability).