How to Disable Lazy Loading in WordPress (And Why You Should Do This)

Please note that I may earn a small commission from purchases made through product links in this article at no extra cost to you. I only recommend products I use now, have used in the past, or would use if there was a personal need.

 

Last updated: August 13, 2020

With the release of WordPress 5.5, users now have image lazy loading turned on by default in their websites. That’s right, lazy loading is now a standard feature in WordPress that you can’t just turn off.

I personally don’t like this at all, and in this article I am going to explain how you can disable lazy loading in WordPress. Plus, I am going to give you two reasons why you should consider doing this.

Why Should You Disable the Lazy Loading Feature?

There are a couple of reasons why I think you should consider disabling the new lazy loading feature in WordPress.

1. It Should Be an Optional Feature

Not everyone wants, or needs, lazy loading in their website.

And as such, lazy loading should be an optional feature, instead of it being a standard feature that you can’t turn off.

2. There Are Better Lazy Loading Solutions Available

The WordPress lazy loading feature is super basic. It just lazy loads all your images, and there are no custom settings.

If you use a plugin such as a3 Lazy Load, you have tons of useful configuration options to set up image lazy loading the way you want it to work.

For example, with a3 you can set an image load threshold, which gets your images to load when a user, while scrolling, reaches a pixels threshold. It also allows you to easily exclude images from being lazy loaded by using a class name.

WordPress doesn’t offer any of these essential customization options. At least, not yet.

If you’re not currently using any lazy loading plugin or other solution, you may wish to keep the WordPress lazy loading feature on if you’re happy with it.

But for me, I don’t need it, because by using a good plugin, I can set this up the way I want it to work.

How to Disable WordPress Lazy Loading (3 Steps)

Luckily, disabling the new WordPress lazy loading feature is very simple.

To do this, you need to add a so-called filter to the functions.php file in your WordPress website. However, rather than hacking into that very important WordPress file, I prefer to use a plugin called Code Snippets.

This plugin allows you to add code to your WordPress blog without touching the functions.php file. It’s a lot safer, and it’s nice to have your custom code snippets organized in one spot.

Step 1: Install the Code Snippets Plugin

In your WordPress dashboard, navigate to the Plugins section. Choose Add New and search for Code Snippets. Install and activate that plugin.

Code Snippets WordPress plugin

Code Snippets is a super lightweight and reliable plugin that actually adds value. So don’t worry about having to add another plugin.

Step 2: Implement Code to Disable Lazy Loading

Navigate to the plugin and choose Add New snippet. In the editor box, add PHP code as per the following image:

Code snippet to disable lazy loading in WordPress

This is the copy/paste version of the code:

add_filter( 'wp_lazy_loading_enabled', '__return_false' );

As you can see, it’s just one simple line of code.

Step 3: Activate the Code Snippet

Once you’ve created the code snippet and everything looks good, with no syntax errors, click Save Changes and Activate.

Save and activate the code snippet

Now, browse through your website, and check that your images are loading as per normal.

Also check your HTML source code. Search for an image and check that the following image tag isn’t present:

loading='lazy'

That’s it, all done.

Join Blog Pioneer

JOIN BLOG PIONEER

Subscribe now and learn how to grow your blog into a thriving business with effective SEO and monetization strategies.

BONUS: 3 actionable SEO tips you can implement today to give your blog posts an immediate boost!

 
AJ Mens

I am a corporate IT nerd turned digital marketing enthusiast, specializing in SEO and content strategy. I have been blogging since 2015, and my aim with Blog Pioneer is to help you achieve success online. Connect with me on Twitter and LinkedIn.

4 Comments
  1. I agree with you AJ, this option should be optional.
    But, on the (big) plus side, it forces plugin devs to make their plugins compatible with it. I had so many issues in the past when Lazy Loading was breaking plugin features. 😒

    Reply
    • Thanks Nadya, and yes that’s a good point, plugins (and themes) are now forced to deal with lazy loading, which is kind of a good thing.

      Although luckily I’ve never had any plugin conflicts or other issues using a3 Lazy Load, it’s a really good plugin.

      Reply
Leave a Comment