MegaOptim Image Optimizer – Convert to WebP & AVIF, Compress Images Locally
MegaOptim Image Optimizer – Convert to WebP & AVIF, Compress Images Locally
Description
MegaOptim optimizes the images of your WordPress site on your own server. It creates WebP and AVIF copies of your JPEG, PNG and GIF images, serves them to browsers that support them, and can compress the originals in place. Nothing is uploaded anywhere, and there are no monthly limits.
What it does
- WebP and AVIF copies of every image and thumbnail size, kept next to the original. A copy that would be larger than the original is skipped.
- Delivery through
<picture>markup or Apache/LiteSpeed rewrite rules, with the original as the fallback for older browsers. A CDN URL can be set for the copies. - Compression in place for JPEG and PNG, with three presets: Lossless, Balanced and Smaller files. Advanced settings hold separate WebP and AVIF quality, resizing of large uploads, metadata and the thumbnail sizes to process.
- Backups and restore. Originals are backed up before they are changed, and any image can be restored, one at a time or all at once.
- Bulk optimization of the whole Media Library with one button. It runs in the background, survives closing the page, and shows its progress on the Overview and in Activity.
- New uploads are optimized automatically.
- Folders outside the Media Library, such as theme or plugin image folders.
- Compare an original with its optimized version side by side.
- WP-CLI:
wp megaoptim optimize,restore,statusandstats. - Diagnostics that show which image engines your server offers and what each one can do.
How images are processed
MegaOptim uses what your server already has: the GD or Imagick PHP extensions, and command-line encoders such as cwebp, avifenc, jpegtran, pngquant, oxipng or gifsicle when your host has them installed. The plugin itself contains no executables. AVIF needs GD or Imagick built with AVIF support, or avifenc. Tools Server diagnostics shows what is available on your server.
MegaOptim Pro
MegaOptim Pro is an optional add-on. It brings its own native engine for Linux (MozJPEG, libwebp, libavif, oxipng, pngquant, gifsicle), which compresses noticeably better than GD or Imagick and turns animated GIFs into animated WebP. Its smart quality picks the lowest quality for each image that still looks the same, measured with SSIMULACRA 2. Pro also optimizes media offloaded to S3-compatible storage with S3 Uploads or WP Offload Media, and adds parallel WP-CLI and network-wide tools for multisite. Images are still processed on your server.
Source code
The admin screens are a Vue application. Its source is included in the plugin’s admin folder and is built with bun install && bun run build.
Installation
- Install and activate MegaOptim Image Optimizer.
- Open Media MegaOptim.
- On Settings, pick a preset and the formats to create (WebP, AVIF or both). Tools Server diagnostics shows what your server can do.
- Optimize a few images on the Images screen and compare them with the originals.
- Click Optimize library on the Overview to process everything else. New uploads are optimized automatically.
Screenshots

Overview: library coverage, space saved and one button to optimize the whole library.

Images: every image with its savings and formats, filterable by status and source.

Compare an original with its optimized version.

Settings: a quality preset, the formats to create and optimization of new uploads.

Advanced settings: WebP and AVIF quality, resizing and metadata.

Activity: background work as it happens.

Tools and diagnostics: restore everything, and see what your server can do.
Faq
No. Since version 3.0, everything runs on your server and there is nothing to sign up for.
The MegaOptim cloud service has been retired, and version 3.0 replaces it with local processing. Your settings, optimization history and backups are kept, and the stored API key is removed. Images that were waiting for the cloud are paused and listed, so you can review the new settings and resume them locally. Former paying customers receive MegaOptim Pro free of charge; watch your inbox.
Yes, when your server can encode AVIF: GD or Imagick built with AVIF support, or the avifenc tool. Tools Server diagnostics shows whether it can. MegaOptim Pro includes its own AVIF encoder.
WebP and AVIF copies are separate files; the original stays as it is. Compression does change the original file, so MegaOptim backs it up first (unless you turn backups off) and you can restore it at any time from the Images screen or with wp megaoptim restore.
Only with the Lossless preset. Balanced and Smaller files reduce quality slightly in exchange for smaller files. Use Compare to check the result on a few images before optimizing the whole library.
MegaOptim skips a copy that would be larger than the original, which happens with images that are already well compressed. The Images screen marks these as “original smaller”. Other reasons are listed in Activity.
With <picture> markup (the default), which works on any server and with most caching plugins, or with rewrite rules for Apache and LiteSpeed, which keep your HTML unchanged. Browsers that do not support a format get the original.
The free plugin optimizes files that are on your server and skips offloaded files with an explanation. MegaOptim Pro optimizes media offloaded with S3 Uploads or WP Offload Media and uploads the WebP and AVIF copies with them.
Yes. wp megaoptim optimize --all optimizes the library, wp megaoptim optimize --folder=<path> a folder, wp megaoptim restore <id> restores an image, and wp megaoptim status shows the queue.
No. Images are processed on your server, and the free plugin does not contact any service.
Reviews
Great Plugin for betterfounder.com
By Better Founder (betterfounder) on September 20, 2024
Thanks for the efforts
Goooooood
By حجره جو (hojrejo) on December 31, 2023
👌👌👌👌👌👌👌
Good
By pongsak465 on July 25, 2023
Good job!!
works great
By tv4265 on July 20, 2023
Works well with PHP version 5.6.20.
Best free app
By thehappiestman on May 9, 2023
5 Star, best one, does the job
Great tool
By PHILROW (PHIROW) on April 27, 2023
Wonderful
Sweet!
By razvanpandor on April 19, 2023
Saved me lots of space on my tiny hosting server!
Отличный плагин
By wpwebr on February 28, 2023
Простой и много опций. Перебрабрал несколько, остановился на этом 🙂
Indico
By letsgorock on February 15, 2023
Só podiam aumentar a cota free mensal
simple and efficient
By raduvladescu on February 15, 2023
Easy instalation. Many features for free.
Changelog
3.0.0
- All optimization now runs on your server. The cloud API, API keys and image credits are gone.
- A redesigned admin: Overview, Images, Settings, Activity and Tools, with one Optimize action for compression and WebP/AVIF.
- Settings presets (Lossless, Balanced, Smaller files) with separate WebP and AVIF quality.
- Better JPEG output with Imagick and GD: progressive encoding, optimized Huffman tables, and never a higher quality than the source.
- Originals are backed up before every change, for media and folder images, and restore no longer re-optimizes the restored file.
- Native encoders keep a photo’s embedded color profile, so photos from cameras and editors no longer fall back to Imagick.
- A new background queue: atomic claims, two images at a time, and progress that continues when the page is closed.
- WebP and AVIF copies that would be larger than the original are recorded as such instead of being retried.
- Offloaded media is detected and skipped with an explanation instead of failing.
- WP-CLI:
wp megaoptim optimize,restoreandstatus. - The plugin no longer contains executables; it uses GD, Imagick and tools installed on the server.
- Upgrades from cloud versions keep settings, history and backups, remove the stored API key and pause pending cloud work for review.
2.0.2
- File System view: Convert and Compress now work on folders and single files, with live progress.
- Fix: Convert no longer drops thumbnail siblings. Every thumbnail size now produces its own WebP and AVIF file.
- Fix: forced re-convert kept the freshly converted files instead of wiping them at the end of the run.
- Polished folder modal (mode-aware hero, force re-process toggle, cancel-during-run, per-file failure list).
2.0.0
- Complete refactor of the plugin (Vue 3 admin, modern PHP architecture, new conversion engine for WebP/AVIF, File System view, queue monitor, WP-CLI commands).
- Backwards compatible: legacy v1.x mode remains available and existing settings and attachment data are migrated in the background.
Older versions are listed in changelog.txt.