YS WebP Tools
Upload automatic conversion to WebP, intelligent thumbnail management, making website images smaller and faster.
Images often account for more than half of a webpage's weight. YS WebP Tools makes image optimization a "set it and forget it" process: newly uploaded images are automatically converted to WebP and automatically resized to your maximum specified dimensions. Old images can also be organized in batches with a batch tool. Website speed and disk space will immediately improve.
Upload and optimize, without changing your workflow
Once enabled, simply upload images as usual. The plugin will handle WebP conversion and thumbnail generation in the background of the media library. You can choose to replace the original file or keep the original file and save a new one. You don't need to change any of your habits when editing content.
Thumbnail Size Governance: Cutting Out Invisible Waste
WordPress, along with themes and plugins, registers a large number of thumbnail sizes, resulting in multiple copies of every uploaded image. "Thumbnail Sizes Management" lays out all registered sizes and allows you to disable unneeded ones individually or with a single click, saving disk space from the source.
Can organize both photos and files at once
"Existing Image Tools" offers two batch regeneration modes:Clear inactive dimensions(Only delete old thumbnails of disabled sizes, the safest way, no impact on existing URLs) andComplete overhaulAdditionally, there's "Content Image URL Repair," which scans articles for image URLs pointing to non-existent files and replaces them with valid ones. It defaults to a dry run for preview before execution. All destructive functions are disabled by default.
Features
Upload and automatically convert to WebP
New uploaded images are automatically converted to WebP, which can replace the original file or be saved alongside it.
Automatically resize thumbnail to the largest width and height
Automatically shrink oversized images that exceed the set dimensions, to avoid uploading original 6000px images directly to the media library.
Thumbnail Size Management
Display all registered thumbnail sizes, and disable excess sizes one by one or with a single click.
Batch Rebirth (Two Modes)
"Clean disabled sizes" (safe, does not move URLs); "Full rebuild" (rebuilds all thumbnails according to settings).
Content image URL repair
Scan broken image URLs in the article and replace them with valid URLs. Preview before executing.
Security Defaults
Destructive functions are disabled by default. Back up before executing. Batch processing will not time out.
Screenshots
Changelog (Latest)
Add New
- filter `ys_webp_tools_convert_upload`The parameter `( bool $convert, array $file )` returns `false’, keeping the original file; it is called only when the original file is set to be converted; it does not affect automatic thumbnailing. All upload entries go through: the Media Library window, the Media Add page, the Block Editor (REST), `media_handle_sideload()`/`media_sideload_image()` in WP-CLI import, and the thumbnail preview generated by the WordPress 7.1 browser side processing (the default follows the main file format; the same attachment will not be half WebP and half original format).When the main file is not converted to WebP, such as the preview image for a PDF, the GIF cover that hasn’t been converted, and the supplementary thumbnail image remains in its original format, consistent with the way the server generates thumbnails (1.2.3 converts them to WebP). The README includes an example of “Notify Credit Logo to Maintain Original Image.”
Change
- General settings have been changed to display the current status.Remove the “Security warning: WebP conversion and auto thumbnailing are set to off”, and replace it with “When uploading, convert to WebP” (enabled with both quality and width/height limits, or not enabled); “Auto-scale” (enabled with both width and height limits, or not enabled); when switching between on and off, unchecked formats, no upper/lower limits, the host’s image processing component cannot output WebP, or other plug-ins that convert WebP to other formats will mark it as not enabled and explain why. Each item includes a link to the corresponding page tab, which will be updated immediately after saving.
- The external app only deletes files at the bottom of the uploads folder.Before batch resizing and deleting with the "Existing Image Tool", please make sure the file is in the uploads folder first; if it's not, it won't be deleted.
Fix
- When the host cannot output WebP, the original uploaded image will be deleted.(Starting with 1.0.0): The main machine's image editor does not support WebP (for example, Imagick does not support WebP, GD does not compress WebP), the core will be converted to JPEG, the old version will delete this file as a failed conversion, resulting in the original image being deleted; when uploading PNG, it will overwrite and delete the JPG with the same name; that could be a file from another attachment. Now, when extracting the editor, you need to output WebP (Imagick does not support it, but if GD supports it, use GD instead); if they do not support it, do not convert it; the original image is kept; after saving, only the WebP file that you specify and that did not exist before saving is deleted.
- When using a different plugin to convert WebP to another format, it no longer overwrites the original image or the same-named file for other images.When other plug-ins (or custom programs) use `image_editor_output_format` to convert WebP to other formats, WordPress generates thumbnails by converting the converted WebP file again and saving it in the same name file, without checking for duplicates. As a result, the original image uploaded by the user is overwritten with the same name master file or the same name master file for other images. This situation is no longer occurring; the original image remains unchanged, and the "Current Status" page displays "Not applied (other plug-ins convert WebP to other formats)."
- The "WebP Quality" setting is now really taking effect.Starting with 1.0.0, we use the same quality settings as WordPress. By default, 86 is used. When transferring plugins, the quality settings in the plugins are converted to the WordPress quality settings. Now, the WebP exported by the plugins (the image uploaded, and the smaller thumbnail and `-scaled’ image processed by the WordPress 7.1 browser) are saved with the same quality settings as the default station. After upgrading, these files will be smaller than before. When processed by the server, WordPress itself uses the thumbnail generated from the master file, and the `-scaled’ image used on the website when the size exceeds 2560 px, still uses the WordPress quality settings (default 86, other plugins may have changed this).
- The source_original of the WordPress 7.1 patch is no longer being uploaded.The original format file that remains next to the attachment (for example, the file next to HEIC) is kept in its original format; it is not converted to WebP or deleted.
- The "Disable thumbnail size" feature in WordPress 7.1 browser side processing does not take effect.When the block editor is handled by the browser when thumbnailing, the server uses `wp_get_missing_image_subsizes()` to tell the browser what sizes to use. This list was previously kept intact; unused sizes (such as medium_large) were still generated. Now they are also removed; unused sizes are not added when uploading is interrupted and thumbnailing is performed.
- WordPress 7.1 browser-side processing + "Retain Original File" will leave orphaned files behindAfter the browser completes the conversion and saves the thumbnail to the attachment as a scaled image and converts it to WebP, the original format file (for example, photo-150x150.jpg) is also saved; the attachment only contains the WebP file; no one has referenced this file; deleting the attachment will not delete it. Now that the conversion is complete, delete it. The "retain original file" option remains unchanged: what is retained is the original image uploaded by the user (the original file of the attachment main file), and WordPress or the browser saves the WebP image created from it, just as when generating the thumbnail from the server. The original format orphan thumbnail that has already been saved in 1.2.3 will not be automatically deleted.
FAQ
Will it affect existing image URLs?
The "Clean Disabled Sizes" mode only deletes thumbnail files of disabled sizes. Active sizes and main files remain completely unaffected, and existing URLs are not impacted. "Full Rebuild" will rebuild all thumbnails. It is recommended to back up your data before proceeding.
What environment is needed?
WordPress 6.0 or higher, PHP 8.0 or higher, and your host must have the GD or Imagick image library (most hosts have this built-in).
Is the original file still there after converting to WebP?
Your choice: "Replace Original File" to save the most space, or "Keep Original File" to have both for future needs.
Why is it recommended to disable redundant thumbnail sizes?
Each registered size will create an additional copy for every uploaded image. Most websites typically use only three to four sizes. Disabling the remaining sizes can save a considerable amount of disk space.
