WordPress 6.x and the Performance Lab plugin keep chipping away at how responsive images get sized. I have been following the Auto Sizes discussions, and it is about time somebody dealt with the sizes attribute bottleneck. The chat on April 21, 2026 laid out a roadmap worth reading if you care about WordPress Core Performance.
The problem with static image sizes
For years WordPress has generated the sizes attribute from a set of breakpoints. That worked without ever being accurate. In a complex layout like the Gallery block, the browser downloads a larger image than it needs because the sizes attribute does not match the size the image actually renders at. Your LCP (Largest Contentful Paint) pays for that, and so does WordPress Core Performance in general.
Weston Ruter and the performance team have moved the “Auto Sizes” feature up the queue. Any change to a core API this old comes with war stories, and this one already has a few: images in galleries turn up skewed or distorted when sizes="auto" is applied and nothing handles the aspect ratio. GitHub issue #2449 tracks the remaining Gallery block quirks that have to be cleared before this can be proposed for WordPress Core.
If you have hit the same wall, my earlier write-up on fixing Fetchpriority logic covers the other half of asset loading.
Refactoring for WordPress core performance
While Performance Lab experiments with these features, the job on our side is keeping custom themes from breaking. The mistake I keep running into is a developer force-fixing the sizes attribute by regexing the the_content filter. That is a race condition in waiting, and it makes a mess of server-side transients.
The right place to change how WordPress calculates responsive image attributes is the hook built for it. Here is the safer version:
<?php
/**
* Adjusting image sizes attributes for better WordPress Core Performance.
*/
function bbioon_optimize_gallery_auto_sizes( $sizes, $size, $image_src, $image_meta, $attachment_id ) {
// Only apply logic if we are on the frontend and not in the admin
if ( is_admin() ) {
return $sizes;
}
// Example logic to ensure 'auto' is included for lazy-loaded images
// This aligns with the roadmap discussed in the performance chat.
if ( false !== strpos( $sizes, '100vw' ) ) {
return 'auto, ' . $sizes;
}
return $sizes;
}
add_filter( 'wp_calculate_image_sizes', 'bbioon_optimize_gallery_auto_sizes', 10, 5 );
Why the Gallery block is the final boss
In the chat, the Gallery block came up as the “final boss” between this work and a core merge. Galleries lay out with CSS grid or flexbox, so the browser has no idea how wide an image will be until the CSS is parsed. sizes="auto" hands that decision to the browser at runtime, which only works if aspect-ratio stays intact. Otherwise you trade a bandwidth win for layout shift (CLS).
Mukesh and Ravi are looking for testers. If you run a high-traffic site, spin up staging and try the current Performance Lab updates. The legacy hacks have a shelf life, and native browser features are what replaces them.
If this is eating your dev hours, I can take it off your plate. I have been working with WordPress since the 4.x days.
The road ahead
The next performance chat is on May 5, 2026, still focused on stabilizing the “Enhanced Responsive Images” module. Getting the Gallery block right would make images faster on every WordPress site, which is a rare kind of win. Until then, keep your transients clean and your hooks precise. I will be in the Slack logs.