Lazy load still active despite filter in functions.php

In an effort to speed up my LCP I noticed that the core Wordpress lazy load was applying to my above-the-fold images. Per recommendation from @Louis I added a filter to remove default lazy load in my functions.php:

add_filter( 'wp_lazy_loading_enabled', '__return_false' );

However, it seems like loading="lazy" is still be applied to my images. For example:

https://wordpress-893315-3099012.cloudwaysapps.com/5-tips-for-camo-challenges-in-modern-warfare-2/

Environment: Cloudways

Potential plugin impact (though, have disabled everything and same effect):

  • Breeze
  • Imagify

Wordpress/Cwicly

  • WordPress version: 6.1.1
  • Gutenberg Plugin version: -
  • Cwicly Plugin version: 1.2.8.7.3
  • Cwicly Theme version: 1.0.3

It may be something specific to Gutenberg ‘post featured image’ block - currently testing and will update here.

Hi @Jason,

I’m going to move this to General as I can’t reproduce this on my side.
We have also added the “eager” parameter for the loading property to allow you to address the situation without modifying other images on your page.

Don’t hesitate to let me know if you’re still experiencing trouble with this.

Thanks.

Yes, featured images have to be treated separately. I used this:

add_filter('wp_get_attachment_image_attributes', function ($attr, $attachment = null) {
	$attr['loading'] = 'eager';
	return $attr;
});

Now I don’t and I try to only add loading=eager to images above the fold.