Effortless WebP Converter
Effortlessly convert WordPress images to WebP from the dashboard. Auto-serve WebP to supported browsers — safe, fast, no originals lost.
by Nasratul Nayem · github.com/nasratulnayem/wordpress-webp-image-converter · website
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/nasratulnayem/wordpress-webp-image-converter/releases/download/v0.1.0/effortless-webp-converter.zipReadme
WordPress WebP Image Converter
Effortlessly convert WordPress images to WebP from the dashboard. Serves WebP automatically to supported browsers — safe, fast, no originals lost.
Features
- One-click scan — counts all convertible JPEG (and optional PNG) images in your media library
- Batch conversion — processes images in configurable batches via AJAX, no server timeout worries
- Automatic serving — swaps image URLs to
.webpfor browsers that support it (viaAcceptheader) - Srcset support — converts
srcsetURLs so responsive images also benefit - Content rewriting — optionally swaps hardcoded image URLs inside
the_contentandpost_thumbnail_html - Safe by design — originals are never deleted; a failed conversion won't break your site
- Imagick + GD fallback — works with either library
- Full dashboard UI — no WP-CLI, no external tools needed
Screenshots
Screenshots will be added in a future release. Contributions welcome!
┌─────────────────────────────────────────────┐
│ Effortless WebP Converter │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Status │ │ Settings │ │
│ │ Total: 142 │ │ Batch size: 10│ │
│ │ Converted: 89 │ │ Quality: 82 │ │
│ │ Progress: ██░ │ │ Include PNG ☑│ │
│ └──────────────┘ └──────────────┘ │
│ ┌──────────────────────────────────┐ │
│ │ Environment │ │
│ │ ✓ Imagick Available │ │
│ │ ✓ GD WebP Available │ │
│ └──────────────────────────────────┘ │
│ ┌──────────────────────────────────┐ │
│ │ Recent Log │ │
│ │ [12:34] Scan complete. │ │
│ │ [12:35] Attachment 42 converted │ │
│ └──────────────────────────────────┘ │
└─────────────────────────────────────────────┘
Requirements
| Requirement | Minimum |
|---|---|
| WordPress | 6.0+ |
| PHP | 7.4+ |
| Image library | Imagick (with WebP) or GD (imagewebp()) |
Installation
- Download the latest release from GitHub Releases
- Upload the
effortless-webp-converterfolder to/wp-content/plugins/ - Activate Effortless WebP Converter from the WordPress Plugins screen
- Go to Tools → WebP Converter
- Click Scan Library to count convertible images
- Click Start Conversion to begin batch processing
Quick install via WP-CLI
wp plugin install https://github.com/nasratulnayem/wordpress-webp-image-converter/releases/download/v0.1.0/effortless-webp-converter.zip --activate
wp eval 'do_action("ewc_scan");'
Usage
Dashboard
Navigate to Tools → WebP Converter in the WordPress admin sidebar.
| Action | Description |
|---|---|
| Scan Library | Counts all convertible JPEG/PNG attachments in the media library |
| Start Conversion | Processes images in batches — runs until all are converted |
| Reset Report | Clears the conversion log and stats |
Settings
| Setting | Default | Description |
|---|---|---|
| Batch size | 10 | Images processed per AJAX request (1–50) |
| WebP quality | 82 | Output quality (40–100) |
| PNG conversion | On | Also convert PNG uploads to WebP |
| Hardcoded content images | On | Swap image URLs in post content and thumbnails |
How it works
- Scan — queries the
wp_poststable for attachments withpost_mime_type IN ('image/jpeg', 'image/png') - Convert — for each attachment, generates
.webpcopies of the original file and all registered thumbnail sizes using Imagick or GD - Serve — intercepts
wp_get_attachment_url,wp_calculate_image_srcset, and optionallythe_content/post_thumbnail_htmlto swap URLs when:- The browser sends
Accept: image/webp - The corresponding
.webpfile exists on disk
- The browser sends
Originals are never modified or deleted. The plugin only creates new .webp files alongside them.
Development
# Clone the repo
git clone https://github.com/nasratulnayem/wordpress-webp-image-converter.git
# Install dependencies (if any)
# No build step required — this is a vanilla PHP plugin
Coding standards
This plugin follows WordPress Coding Standards.
composer lint
composer lint:fix
Frequently Asked Questions
Does this delete my original images?
No. The plugin never deletes or modifies original files. It only creates new .webp copies alongside them.
What if a conversion fails?
The plugin skips the failed file and continues with the rest. Your original image remains untouched, so your site is never affected.
Does it work with CDNs?
Yes, as long as the CDN serves the .webp file when requested. The URL swap happens on the WordPress side before the CDN fetches the resource.
Does it support PNG?
Yes. Enable PNG conversion in the settings. PNGs with transparency are handled correctly (Imagick preserves the alpha channel; GD converts palette to true colour and saves alpha).
Will this work with page caching plugins?
Yes. The WebP serving logic runs during page rendering (via filters), so cached pages will serve the format the original request accepted. For best results, ensure your cache varies on the Accept header.
Changelog
0.1.0 — Initial Release
- Scan media library for convertible JPEG/PNG images
- Batch conversion with configurable batch size and quality
- Automatic WebP serving via
wp_get_attachment_urlandwp_calculate_image_srcset - Optional content URL rewriting (
the_content,post_thumbnail_html) - Dashboard admin page with progress bar, stats, log viewer
- Supports both Imagick and GD
- Safe mode — originals never modified
Contributing
Contributions are welcome! Please open an issue or pull request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
GPL-2.0-or-later — see LICENSE for details.
Support
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| v0.1.0 | May 25, 2026 | effortless-webp-converter.zip | 12 |