Webp widget upload
WebP Widget Upload converts JPG and PNG images to WebP as soon as they are uploaded—but only for the image fields you choose.
If you want smaller image files stored on the server without setting up complex optimization pipelines, enable the fields you care about, set a quality value, and new uploads are converted automatically. The original JPG/PNG is replaced by a WebP file (same file entity).
Works with Drupal 10.3+ and Drupal 11.
Features
- Convert uploaded JPG/PNG images to WebP automatically on upload
- Enable or disable conversion per image field (nodes, media, taxonomy terms, and other entities with image fields)
- Configurable WebP quality (0–100)
- Conversion runs during upload (including AJAX uploads on entity forms), not only on save
- Shows WebP conversion status in the image widget settings summary
- Checks for PHP GD WebP support at install and on the status report
Use this module when you want the stored source file itself to be WebP for selected fields—useful for reducing disk usage and serving lighter originals without relying only on image-style derivatives.
Post-Installation
1. Enable the module (Composer or the Extend page).
2. Confirm PHP GD WebP support on Reports → Status report (the module reports this).
3. Go to Administration → Configuration → Media → WebP Widget Upload
(`/admin/config/media/webp-widget-upload`).
4. Set WebP quality (recommended: 75–85).
5. Check the image fields that should convert uploads to WebP.
6. Save configuration.
After that, upload a JPG or PNG to an enabled field. The file is converted to WebP immediately and the original is replaced.
Notes:
- Already-WebP uploads are skipped.
- Ensure `.webp` is allowed in the field’s allowed file extensions if your field restricts extensions.
- Keep backups if you still need the original JPG/PNG files—conversion is destructive for the source file.
Additional Requirements
- Drupal core `^10.3 || ^11`
- Core modules: File, Image
- PHP GD extension with WebP support (`imagewebp`)
No additional contrib modules or external libraries are required.
Recommended modules/libraries
- Responsive Image (Drupal core) — pair WebP source files with responsive displays where needed
- Image styles / Image toolkit (Drupal core) — Drupal can also generate WebP derivatives; this module focuses on converting the uploaded source file
Optional related tools if you need derivative-based or pipeline optimization instead of (or in addition to) source conversion:
- [WebP](https://www.drupal.org/project/webp)
- [ImageAPI Optimize](https://www.drupal.org/project/imageapi_optimize) / [ImageAPI Optimize WebP](https://www.drupal.org/project/imageapi_optimize_webp)
Similar projects
- [WebP](https://www.drupal.org/project/webp) — creates WebP copies of image style derivatives for browsers that support WebP; it does not replace the uploaded source file per selected field.
- [ImageAPI Optimize WebP](https://www.drupal.org/project/imageapi_optimize_webp) — adds WebP processing inside an ImageAPI Optimize pipeline; better for advanced optimization workflows.
- Image WebP Converter / Smart Image Optimizer — broader conversion tools (batch jobs, extra formats, or third-party libraries).
WebP Widget Upload is intentionally small: field-level control, convert-on-upload with GD, no external converter library, and a simple admin UI. Choose it when you want selected fields to store WebP originals with minimal setup.
Supporting this Module
Bug reports, feature requests, and patches are welcome in the issue queue:
https://www.drupal.org/project/issues/webp_widget_upload
If you use this module in production, please report issues and help test new releases.
Community Documentation
- README in the module package
- Project page: https://www.drupal.org/project/webp_widget_upload
- Issue queue: https://www.drupal.org/project/issues/webp_widget_upload
Video walkthroughs and demo sites will be linked here when available.