Pixellize Image Optimizer
A free WordPress plugin that automatically converts uploaded images to WebP, so your pages load faster and use less bandwidth.
Everything happens on your own server using PHP GD or Imagick. There is no cloud account, no API key, and no paid tier. You upload images the way you always do, and the WebP version is ready immediately.
- Automatic WebP conversion for every new upload, including all thumbnail sizes
- Bulk optimization for images already in your library, with a live progress bar and background processing
- A server-level “Serve WebP everywhere” option that covers themes, page builders, and CSS backgrounds
- An “Optimize images” button in the admin toolbar to convert a single page’s images on demand
- Optional resizing of large uploads before conversion
- A Keep Original option, with a one-click Restore in the Media Library
- Automatic cleanup of WebP files when you delete an image
- A simple settings page with a savings panel
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- PHP GD extension or Imagick extension (most hosts have at least one)
The plugin checks for GD or Imagick on activation. If neither is available it will not activate, and an admin notice tells you what is missing.
Installation
From the WordPress directory (recommended)
- In your WordPress admin, go to Plugins then Add New.
- Search for Pixellize Image Optimizer.
- Click Install Now, then Activate.
Manual upload
- Download the plugin ZIP from wordpress.org.
- Go to Plugins then Add New then Upload Plugin.
- Choose the ZIP, install, and activate.
Quick start
- Install and activate the plugin.
- (Optional) Go to Tools then Pixellize Image Optimizer to review settings.
- Upload images the way you always do.
WebP versions are generated automatically. That is the whole setup.
Settings
All settings live at Tools > Pixellize Image Optimizer.
Image formats to convert
Choose which uploaded formats should be converted to WebP.
- JPG / JPEG and PNG are on by default.
- BMP and AVIF are off by default. Turn them on if you upload those formats.
WebP quality
A slider from 0 to 100. Default is 85.
- 80 to 90 gives the best balance of file size and visual quality.
- Values below 60 can show visible artifacts on detailed photos.
Resize large uploads
A toggle. Off by default. When on, uploads larger than the maximum width or height you set (default 2048px) are scaled down before conversion, preserving the aspect ratio. This often saves more than the WebP conversion itself. Only new uploads are affected, existing images are never changed.
Keep original image
A toggle. Off by default.
- Off: the upload is replaced by a WebP and the original is deleted to save space.
- On: the original stays in your Media Library and a WebP is built for the full image and every thumbnail size. You can restore any image back to its original.
Serve WebP everywhere (server level)
A toggle. Off by default. Requires Keep Original to be on, because the original file must stay on disk. When enabled, the server delivers the WebP version of any image that has one, no matter where it comes from: themes, page builders, custom fields, widgets, even CSS background images. If an image has no WebP, its real format is served, so nothing breaks.
- Apache or LiteSpeed: a small rewrite rule is added to the uploads folder .htaccess. Zero per-page overhead, and it also covers images referenced inside external CSS files.
- Other servers (such as Nginx): the plugin falls back to rewriting the page output automatically. This covers everything except images inside external CSS files.
How it works
On upload
When you add an image to your Media Library, the plugin generates a WebP version.
- If Keep Original is off: the upload is replaced by a single WebP and the original is removed.
- If Keep Original is on: the original stays put and a WebP copy is created for the full image and every thumbnail size, so responsive markup is fully covered.
On the front end
The plugin swaps image URLs to the WebP version in the right places:
- Theme image tags (the standard WordPress attachment image)
- The responsive
srcsetattribute - Image URLs inside post content
- The Media Library preview and details
If a WebP is not available for a given file, the original is served instead. Nothing breaks.
If a conversion fails
The original is left untouched and an admin notice appears on the next page load with the file name, MIME type, and a clear reason. Nothing is silently dropped.
Bulk optimize existing images
The settings page includes a Bulk optimize existing images tool. It builds a WebP version for every image that was already in your library before the plugin, including all generated thumbnail sizes.
- The run is additive: originals are always kept, so existing links and pages never break.
- A live progress bar shows how many images are done, with a Stop button at any time.
- Processing continues in the background through a scheduled task, so you can close the tab once it starts.
- If you reload the settings page during a run, the progress bar picks up where it left off.
- Images that already have a WebP version are skipped automatically, so re-running is safe.
Optimize a single page from the toolbar
While viewing any post or page on the front end, an Optimize images button appears in the admin toolbar. One click builds WebP for just that page’s images: the featured image, images in the content, attached media, and even images printed by the theme or page builder.
The button shows a live count as it works (1 / 3, 2 / 3, 3 / 3), clears the page cache, then reloads the page so you immediately see the WebP versions. Useful for getting your most important pages onto WebP first, without waiting for a full library run.
Keep Original mode
The default behavior replaces every upload with a single WebP to save disk space. Turn on Keep original image in the settings if you want to:
- Keep your source files in the Media Library
- Be able to restore any image back to its original later
- Offer downloads of original files
With this option on, both formats sit on disk side by side. Visitors are served the lighter WebP automatically, and you keep the originals safe for whenever you need them.
Restore an image
With Keep Original turned on, a Restore original link appears in the Media Library row actions for any WebP attachment that has its original on disk.
Clicking it:
- Points the attachment back at the original file.
- Rebuilds all of its sizes from the original.
- Removes the WebP copies that are no longer needed.
This is the safe way to roll a single image back without touching anything else.
Statistics
The settings page includes a savings panel that shows:
- Number of images converted
- Total original size
- Total WebP size
- Total saved (in bytes and as a percentage)
Use the Reset statistics button to clear the counters and start tracking from zero.
Supported formats
| Format | Default | Notes |
|---|---|---|
| JPG / JPEG | On | Best fit for photos. |
| PNG | On | Works for transparent and non-transparent PNGs. |
| BMP | Off | Turn on in settings if you upload BMP files. |
| AVIF | Off | Needs a server with AVIF read support in GD or Imagick. Best on PHP 8.1+. |
| WebP | Skipped | Already optimized, so the plugin leaves it alone. |
File naming
WebP files mirror the original filename, so the Media Library stays predictable:
photo.jpgbecomesphoto.webpphoto-300x200.jpgbecomesphoto-300x200.webp
If you upload a second image with the same name, WordPress renames the upload to photo-1.jpg as usual,
and the WebP follows: photo-1.webp.
FAQ
Does it convert images already in my library?
Does the bulk run stop if I close the tab?
Is the original image deleted?
Can I get an image back to its original?
What if my server does not support GD?
Can I control image quality?
What happens if I upload a WebP file?
Does it work with my cache or CDN?
Troubleshooting
The plugin will not activate
This usually means neither PHP GD nor Imagick is installed on your server. Ask your host to enable one. Most modern hosts support both.
A specific image failed to convert
The plugin shows an admin notice on the next page load with the file name, MIME type, and a clear reason (for example, a corrupt source file or missing AVIF support). The original file is left untouched so nothing is lost.
My old images are not WebP
Run Bulk optimize existing images from Tools, Pixellize Image Optimizer. It converts everything already in your library, including all thumbnail sizes, and keeps the originals.
AVIF uploads fail
AVIF reading needs a server where GD or Imagick is built with AVIF support. Some hosts do not include that yet. PHP 8.1 or higher with a recent libavif is the most reliable combination.
Images look soft after conversion
Quality may be set too low. Raise it to 85 or higher in the settings and re-upload the image.
Changelog
0.5
- New Bulk optimize existing images tool with a live progress bar. Runs in small batches and continues in the background through a scheduled task, so it survives closing the tab.
- New Serve WebP everywhere (server level) toggle. Delivers WebP for images from themes, page builders, custom fields, and CSS backgrounds via an uploads .htaccess rule on Apache and LiteSpeed, with an automatic page-rewrite fallback on other servers.
- New Resize large uploads toggle. Scales large uploads down to a maximum width or height (default 2048px) before conversion. Off by default.
- New Optimize images button in the admin toolbar to build WebP for a single page’s images on demand, with a live count, cache clear, and reload.
- Full WebP srcset on attachment images and content images, so responsive images serve WebP at every size.
- The Savings panel refreshes after a bulk run so totals include the images just processed.
- New Settings link on the Plugins page for quick access.
0.4
- New Keep Original mode that keeps your source files alongside the WebP for every size.
- New Restore original action in the Media Library for one-click rollback.
- Originals and WebP copies are cleaned up together when you delete an image, so no files are left orphaned on disk.
- WebP is generated for the full image and every thumbnail size, so responsive markup is fully covered.
- Cleaner WebP file names that mirror the original (image.jpg becomes image.webp).
- Redesigned settings page with a savings panel.
0.3
- Compatibility testing with the latest WordPress release.
- WordPress Coding Standards compliance, documented intentional uses of low-level file operations and direct database counter updates.
- Improved error logging for anonymous upload failures (gated behind WP_DEBUG).
0.2
- Admin notices on conversion failure with file name, MIME type, and a clear reason.
- Per-user failure log of the last 10 events, shown on the next admin page load.
- Unique WebP filenames when a same-name image already exists.
- Statistics panel and Reset Statistics button on the settings page.
- Atomic SQL increments for stats, so concurrent uploads no longer drop counts.
- Clean uninstall that removes all plugin options and per-user data.
0.1
- Initial release.
- Auto WebP conversion for JPG, PNG, BMP, and AVIF.
- GD with Imagick fallback.
- Quality control and format selection settings.
- URL replacement across the site.
Support
Need help or want to share feedback?
The plugin is free and open source under the GPL v2 or later license.