How to Fix Skewed or Stretched Images in WordPress

Doug

Tech Stack Integrator

As of WordPress 6.7+ (particularly 6.7.1) there is a “bug” with how images are resized based on a new lazy-loading feature. WordPress is setting image dimensions using “auto” which will skew or distort images and make them look distorted — usually too wide.

To fix this issue, you have a couple of options.

If you’re using a block builder like Spectra, you can simply toggle the “disable lazy load” for each image. Your builder of choice may have the option to disable lazy loading or it may not. However, sometimes disabling lazy load is not enough. If that doesn’t work, we need to move on to the next option.

If you want to fix the issue sitewide without having to make any additional edits, add this function to your child theme’s functions.php file.

// Disable auto-sizes to fix a bug introduced in WordPress 6.7.1
add_filter( 'wp_img_tag_add_auto_sizes', '__return_false' );

All of your images will no longer be skewed.