How to disable the native WordPress lazy load function.
Paste the snippet below into your theme functions.php file:
/**
* Disable WordPress default image lazy load
**/
add_filter( 'wp_lazy_loading_enabled', '__return_false' );
For those wondering why I think most sites should disable image lazy load, read this:
Regev
Since when does WP lazy loads images automatically? Why would plugins allow you to Enable it if its already happening by default?
Johnny
It’s been recently done. https://make.wordpress.org/core/2020/07/14/lazy-loading-images-in-5-5/
Regev
Goddammit!
Rico2000
Hello
I find your topic on Google, i got problem on https://mobilecheats.edu.pl with lazy.
I add your code in functions.php but still show problem with lazy.
Can u tell me more how we can solved that problem?
Kingsley Felix
I have tried this code it does not seem to work
Patrick
Hi Johnny,
thanks for sharing this. Unfortunately I tried your code as well on a customers page and it does not seem to work.
Any ideas what could be the reason?
Best regards,
Patrick
Johnny
Hmmmm….I’ll probably have to check and see if things got updated. Is this just one particular site or all sites you tried?
Johanna
Hi
I have, a problem with this tricks. I add this code to functions.php but its not working. I use generatepress theme and wordpress v 6.0.1.
Its my website : https://www.agridane.com/
Please help me 😉
sumon
It’s not working anymore.
Can you update the snippet?
sumon
Okay, I’ve found a solution at last that works: https://weusewp.com/tutorial/disable-wordpress-native-lazy-loading/