Image Optimizer
Auto-compress, resize, convert to WebP, lazy load, bulk optimize, and generate AI-powered alt text for all your images.
Overview
The Image Optimizer () hooks into WordPress media uploads to automatically compress, resize, and convert images. It works with background processors for non-blocking bulk operations.
Auto-Optimize on Upload
When is on (default), every new image uploaded through the Media Library is automatically:
- Resized to the maximum width (, default: 1920px)
- Compressed to the configured quality (, default: 82)
- Converted to WebP format if enabled (, default: on)
- Logged in with before/after sizes
Image Settings
| Setting | Option Key | Default | Description |
|---|---|---|---|
| Enable Optimization | β | 1 | Master toggle for auto-optimization on upload |
| Quality | β | 82 | JPEG/WebP compression quality (1β100). Lower = smaller files |
| Max Width | β | 1920 | Maximum image width in pixels. Larger images are resized down. |
| WebP Conversion | β | 1 | Generate WebP versions alongside originals Pro |
| Lazy Loading | β | 1 | Add native loading="lazy" to images |
Bulk Optimization
Optimize all existing images at once from the Image Optimizer page (slug: serpelo-images).
serpelo_img_usage_{Ym} option (e.g., ). Pro/Elite: unlimited.Background Optimizer
The Background Image Optimizer () runs optimization in the background without blocking the admin interface. Pro
| Endpoint | Description |
|---|---|
| β | Start background bulk optimization |
| β | Stop the background process |
| β | Check progress (processed/total/percentage) |
WebP Conversion
WebP images are 25β34% smaller than JPEG at equivalent quality. The optimizer generates WebP versions alongside originals. Pro
Lazy Loading
When enabled, the plugin adds the native loading="lazy" attribute to all <img> tags in post content. This defers loading offscreen images until the user scrolls near them.
Alt Text Generation
Missing alt text hurts both SEO and accessibility. The plugin provides multiple ways to fill in alt text:
Bulk Alt Text Generation
| Endpoint | Description |
|---|---|
| β | Find all images in posts missing alt text |
| β | Batch-save alt text for multiple images |
| β | AI-generate alt text for images without it |
Background Alt Generator
The processes alt text generation in the background:
| Endpoint | Description |
|---|---|
| β | Start background alt text generation |
| β | Stop the background process |
| β | Check progress |
Image Statistics
The table tracks every optimized image:
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY
attachment_id BIGINT UNSIGNED NOT NULL
original_size BIGINT UNSIGNED DEFAULT 0
optimized_size BIGINT UNSIGNED DEFAULT 0
webp_size BIGINT UNSIGNED DEFAULT 0
optimization_type VARCHAR(30) DEFAULT 'compress'
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
INDEX idx_attachment (attachment_id)
Statistics are available on the Image Optimizer page and the Dashboard. Total savings are calculated as SUM(original_size - optimized_size).