Image Optimization
Convert images to WebP and AVIF, add missing dimensions, bulk optimize, and serve optimized images automatically.
Last updated Feb 11, 2026
How It Works
BoostPro converts your JPEG and PNG images to WebP and AVIF formats using your server's built-in image libraries (GD or ImageMagick). No external API, no cloud service, no per-image fees. Everything runs locally on your server.
Converted files are stored separately in wp-content/boost-images/, mirroring your uploads directory structure. Original files are never modified or deleted.
Server Requirements
Your server needs at least one of these PHP image libraries with WebP support:
- GD Library with
imagewebp()support (and optionallyimageavif()for AVIF) - ImageMagick with WebP format support (and optionally AVIF format support)
Most modern WordPress hosts include both. BoostPro automatically detects what's available and uses the best option. If neither library supports WebP, the image optimization toggle will be disabled with a message explaining why.
AVIF Support
AVIF conversion requires PHP 8.1+ with GD's imageavif() function or ImageMagick with AVIF format support. Use the Detect button on the Images tab to check if your server supports AVIF. WebP conversion works independently — you can use WebP even if AVIF isn't available.
Tip
Server capabilities are detected and cached automatically. Click the Re-detect button on the Images tab to refresh this information if your server configuration changes.
Enabling Image Optimization
Go to BoostPro → Images and turn on the master toggle. This reveals all image optimization settings organized into three sections: Settings, Delivery, and Bulk Optimization.
Quality Presets
BoostPro offers five quality presets. A single preset automatically maps to the optimal quality value for each format — AVIF achieves equivalent visual quality at lower numbers than WebP:
| Preset | WebP Quality | AVIF Quality | Best For |
|---|---|---|---|
| Lossless | 99 | 80 | Photography sites where quality is critical |
| High | 90 | 65 | Portfolio and design sites |
| Balanced | 80 | 55 | Most websites (good quality with meaningful size reduction) |
| Aggressive | 65 | 45 | Content-heavy blogs and news sites |
| Maximum | 50 | 35 | Maximum compression where file size matters most |
The default is Balanced, which gives 25-35% file size savings with WebP and 40-60% with AVIF, with virtually no visible quality loss for most images.
Auto-Optimize on Upload
When enabled, BoostPro automatically converts images to WebP (and AVIF if enabled) as they're uploaded through the WordPress media library. This includes all registered image sizes (thumbnails, medium, large, and any custom sizes from your theme).
Remove Larger Converted Files
Enabled by default. If a converted file is actually larger than the original (which can happen with already-optimized PNGs or small images), BoostPro automatically deletes the converted file. You only keep converted files that are genuinely smaller.
Image Resizing
Optionally resize oversized images before conversion. If an uploaded image exceeds your maximum width or height, BoostPro scales it down before creating the WebP version.
- Default max: 2560px width, 2560px height
- When to use: If users frequently upload photos straight from their camera at 4000px+ dimensions
Delivery Methods
BoostPro serves optimized images to visitors automatically. There are two delivery methods:
.htaccess Rewrite (Apache/LiteSpeed)
Adds rewrite rules to wp-content/uploads/.htaccess that check the visitor's browser Accept header. If the browser supports AVIF and an AVIF file exists, it's served first. Otherwise, WebP is served if supported. The URL doesn't change, so there's nothing to update in your content.
Picture Tags (Nginx/Universal)
Wraps <img> tags in <picture> elements with AVIF and WebP <source> elements. The browser picks the best format automatically (AVIF first, then WebP, then original). This method handles:
- Standard
srcandsrcsetattributes (WordPress responsive images) - Lazy-loaded
data-srcanddata-srcsetattributes (Elementor, lazysizes, etc.) - Inline CSS
background-imageURLs data-bganddata-background-imageattributes (page builder backgrounds)- Existing
<picture>elements are detected and skipped to prevent double-wrapping
Compatible with WordPress core, Gutenberg, Elementor, Divi, WPBakery, Beaver Builder, and most lazy loading libraries.
Auto Detection
The default "Auto" setting detects your server software and picks the best method. Apache and LiteSpeed get .htaccess rules. Everything else gets picture tags. You can override this if needed.
Bulk Optimization
The Bulk Optimization section shows your current stats (total images, optimized count, space saved) and provides two actions:
- Optimize All Images: Scans your media library and converts all unoptimized JPEG and PNG images to WebP (and AVIF if enabled). Processes in batches with real-time progress counters.
- Delete All Converted Files: Removes all WebP and AVIF files from the boost-images directory and resets the optimization database. Original images are untouched.
Important
Bulk optimization can take time on large media libraries. The process runs in the browser, so keep the tab open until it completes.
Exclusion Patterns
You can exclude specific images from conversion by adding URL patterns to the exclusion list (one per line):
/logo
/favicon
/og-imageAny image whose file path contains one of these patterns will be skipped during both auto-optimize and bulk optimization.
Media Library Integration
When image optimization is enabled, BoostPro adds a column to the WordPress Media Library showing the optimization status of each image:
- Savings percentage and file sizes for optimized images, showing the best format (WebP or AVIF) savings
- Optimize button for unoptimized images — click to convert that individual image without running a bulk operation
- Delete optimized link below the savings stats — removes the converted files for that individual image
- Not optimized for images that haven't been processed yet
- Format not supported for non-JPEG/PNG images (SVG, GIF, etc.)
A "Bulk Optimize" link also appears under the Media menu in the WordPress admin sidebar, which takes you directly to the Images tab in BoostPro.
Add Image Dimensions
Images without explicit width and height attributes cause layout shifts as the browser discovers their size after loading. This hurts your Cumulative Layout Shift (CLS) score.
When enabled, BoostPro automatically adds missing width and height attributes to images in your page content.
- Default: Off
- Supported formats: JPEG, PNG, and SVG (with viewBox)
- Smart sizing: If an image has one dimension set but not the other, BoostPro calculates the missing dimension proportionally from the original image's aspect ratio
Tip
This feature is independent from image conversion. You can enable dimension injection without enabling WebP/AVIF conversion, and it will still help your CLS score.
Image Library Selection
BoostPro can use either GD Library or ImageMagick for image conversion. The default "Auto" setting detects and uses the best available library.
- Auto (default): Prefers ImageMagick when available (generally faster and better quality), falls back to GD
- ImageMagick: Force ImageMagick for conversions. Best quality and performance for most servers
- GD: Force GD Library. Use this if ImageMagick causes issues on your server
Click the Detect button on the Images tab to see which libraries your server supports and their WebP/AVIF capabilities.
Conflict detection
BoostPro automatically detects five popular image optimization plugins (Smush, ShortPixel, EWWW, Imagify, CompressX) and shows an admin notice warning about overlapping features. Running two image optimizers simultaneously can cause double-processing and wasted server resources.
Troubleshooting
- Toggle is disabled: Your server doesn't have GD or ImageMagick with WebP support. Contact your hosting provider.
- Images not converting: Check the Server Capabilities section to verify WebP/AVIF support is detected. Also check that the image is a JPEG or PNG (other formats are not converted).
- Images not served to visitors: Verify your delivery method matches your server. Use Auto for the best results. For .htaccess delivery, confirm your server is Apache or LiteSpeed.
- Converted file is larger: This is normal for already-optimized images. Enable "Remove Larger Converted Files" (on by default) to automatically discard these.
- AVIF toggle not showing: Your server may not have AVIF support. AVIF requires PHP 8.1+ with GD or ImageMagick AVIF support. Click Re-detect to refresh capability detection.