Image Optimization
Local WebP and AVIF conversion with quality presets, bulk optimization, auto-optimize on upload, and automatic delivery.
Last updated Feb 21, 2026
Overview
BoostPro converts your JPEG and PNG images to WebP and AVIF formats using your server's built-in GD or ImageMagick library. No external API, no cloud service, no per-image fees. Everything runs locally on your server, and original files are always preserved.
Converted images are stored in /wp-content/boost-images/uploads/, mirroring your uploads directory structure. A database table (wp_boost_images_meta) tracks per-image conversion status and file sizes.
Enabling image optimization
Go to BoostPro → Images tab and toggle Image Optimization on. This reveals all image optimization settings organized into three sections: Settings, Delivery, and Bulk Optimization.
AVIF conversion
AVIF is a separate toggle that can be enabled independently. AVIF produces smaller files than WebP (typically 20-40% smaller) but requires more server resources and specific library support.
Important
AVIF conversion requires PHP 8.1+ with GD AVIF support or ImageMagick 7.0+. If your server does not support it, enable WebP only.
Image library selection
BoostPro can use either GD Library or ImageMagick for image conversion:
- Auto (default): Prefers ImageMagick when available (generally faster and better quality), falls back to GD
- ImageMagick: Force ImageMagick for all conversions
- GD: Force GD Library. Use this if ImageMagick causes issues on your server
BoostPro auto-detects available libraries on activation. Use the Detect button on the Images tab to refresh capability detection.
Quality presets
A single preset 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 (default) | 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 |
Tip
Balanced quality preset is recommended for most sites. It provides good compression with minimal visual difference.
Auto-optimize on upload
When enabled, BoostPro automatically converts images to WebP (and AVIF if enabled) as they are uploaded through the WordPress media library. This includes all registered image sizes: thumbnails, medium, large, and any custom sizes from your theme.
Skip if larger
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 discards 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 configured maximum width or height, BoostPro scales it down before creating the WebP/AVIF version.
- Default max: 2560px width, 2560px height
- When to use: When users frequently upload photos straight from cameras at 4000px+ dimensions
Delivery methods
BoostPro serves optimized images to visitors automatically. Choose the delivery method that matches your server:
Auto (recommended)
Detects your server type automatically and picks the best method. Apache and LiteSpeed get .htaccess rules. Everything else gets picture tags.
.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 is served first. Otherwise, WebP is served if supported. The URL does not change, so there is 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). Works with all servers including Nginx.
Exclude patterns
Exclude specific images from conversion by adding file path substrings to the exclusion list, one per line:
/logo
/favicon
/og-imageAny image whose file path contains a matching pattern will be skipped during both auto-optimize and bulk optimization.
Add missing 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.
This is a separate toggle, independent from image conversion. 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 aspect ratio
Bulk optimization
The Bulk Optimization section scans your media library for unoptimized images using cursor-based pagination (100 images per batch). Optimization runs in batches of 5 images at a time with real-time progress counters.
- Optimize All Images: Scans and converts all unoptimized JPEG and PNG images to WebP (and AVIF if enabled)
- Delete All Converted: Removes all WebP and AVIF files from the boost-images directory. Original images are untouched.
Media Library integration
When image optimization is enabled, BoostPro adds a custom column to the WordPress Media Library showing per-image optimization status:
- Savings percentage and file sizes for optimized images, showing format and size reduction
- Optimize button for unoptimized images, to convert that individual image without running a bulk operation
- Delete Optimized link below the savings stats, to remove the converted files for that specific image