by Jono Alderson on WordPress.org
Turbocharge your WordPress images by using an edge provider (like Cloudflare or Accelerated Domains) and optimizing your HTML markup.
Edge Images automatically uses your edge transformation service (e.g., Cloudflare, Accelerated Domains, Imgix, etc.) to apply performance optimizations to markup.
⚠️ Important: This plugin requires a supported edge provider with image transformation features enabled (e.g., Cloudflare Pro, BunnyCDN, etc). See the Requirements section for details.
WordPress typically creates multiple copies of each uploaded image in different sizes. This approach is inefficient and often results in:
Edge Images solves these problems by:
Core Features
srcset generation element wrappingAdvanced Features
Your Code
echo wp_get_attachment_image(1, [640,400], false, ['fit' => 'contain']);
What WordPress Usually Outputs
That’s multiple different images files, none of which are the right size!
What Edge Images Outputs
That’s a range of perfectly sized options for different devices and viewports, automatically optimized images in modern formats, served from your CDN, futureproofed for supporting next-generation capabilities, and with no storage overheads.
Transform Parameters
Control every aspect of image transformation with attributes like:
* width/height: Exact dimensions
* fit: Resizing behavior (contain, cover, crop)
* quality: Compression level
* format: Output format (auto, webp, avif)
Filtering
Disable transformations globally or selectively:
// Disable all transformations
add_filter('edge_images_disable', '__return_true');
// Disable for specific images
add_filter('edge_images_disable_transform', function($should_disable, $html) {
if (strpos($html, 'example.jpg') !== false) {
return true;
}
return $should_disable;
}, 10, 2);
// Override max width for constrained content
add_filter('edge_images_max_width', function($max_width) {
// Example: Use a different max width for single posts
if (is_single()) {
return 800;
}
return $max_width;
});
// Customize srcset width multipliers
add_filter('edge_images_width_multipliers', function($multipliers) {
// Add more granular steps between sizes
return [0.25, 0.5, 0.75, 1, 1.25, 1.5, 2];
});
Essential
Technical
Yoast SEO
Automatically optimizes images in:
Edge Images processes images through third-party edge providers. Here’s what you need to know about privacy:
Data Processing
Edge Provider Privacy
Different providers have different privacy implications:
Data Storage
GDPR Compliance