Title: Lazy Load Fix for Divi
Author: jerrystewart99
Published: <strong>January 11, 2025</strong>
Last modified: May 23, 2026

---

Search plugins

![](https://s.w.org/plugins/geopattern-icon/lazy-load-fix-for-divi.svg)

# Lazy Load Fix for Divi

 By [jerrystewart99](https://profiles.wordpress.org/jerrystewart99/)

[Download](https://downloads.wordpress.org/plugin/lazy-load-fix-for-divi.1.1.2.zip)

 * [Details](https://wordpress.org/plugins/lazy-load-fix-for-divi/#description)
 * [Reviews](https://wordpress.org/plugins/lazy-load-fix-for-divi/#reviews)
 *  [Installation](https://wordpress.org/plugins/lazy-load-fix-for-divi/#installation)
 * [Development](https://wordpress.org/plugins/lazy-load-fix-for-divi/#developers)

 [Support](https://wordpress.org/support/plugin/lazy-load-fix-for-divi/)

## Description

Offers Fine-grained control for manually setting the threshold which images on a
Divi page are lazy-loaded.

Includes a fix for a Divi bug that causes incorrect calculation of the lazy-load
threshold.

#### Background

To improve page load performance, modern browsers allow for images and other media
to be lazy loaded. Lazy loading defers media loading until after the first page 
render.

For best page load performance, only _Below The Fold (btf)_ media should be lazy
loaded. _Below The Fold_ means the part of the page that is not visible on first
page load, prior to any scrolling.

Google Page Speed Insights (PSI) will rightly complain if media _atf_ are lazy loaded,
and also if media _btf_ are not lazy loaded.

In version 5.7.0, WordPress added a feature that automatically adds the loading=”
lazy” attribute to media it considers to be _btf_. What it considers _btf_ basically
means everything after the 3rd media component irrespective of page design.

Divi’s Critical CSS feature attempts to do a better job of determining the fold 
by analysing the raw page modules’ shortcodes.
 Divi offers different threshold 
settings of where it considers _The Fold_ to be. eg. ‘Low’, ‘Medium’ or ‘High’. (
This setting is found in Divi Settings|Performance|Critical CSS Threshold.)

The exact position of _The Fold_ however, depends on a few factors, perhaps the 
most obvious is the screen width. Divi’s analysis is approximate and is easily confused
by the use of additional custom css.

#### How the Lazy-Load-Fix-for-Divi plugin works

This plugin allows the developer to determine the exact position of _The Fold_ by
manually setting it’s location for each page. You can do this after making a simple
observation in a browser at the screen widths you want to optimise for.

For example, suppose you decide that you want to optimise for the following screen
resolutions:

    ```
    1200 x 834 - desktop
    320 x 820 - mobile
    ```

(these are the approximate resolutions that Google PSI uses)

Then, after completing your page design, inspect your page in a browser that is 
set to these dimensions`(note 1)` and identify the first Divi module that is _btf_.

To manually set the threshold, add one or more of the custom classes to the first
Divi module _btf_.`(note 2)`.

Allowed values are:

    ```
    ww-btf-desktop
    ww-btf-mobile
    ww-btf-tablet (see note 3)
    ```

All media items _btf_ will be lazy-loaded, those _atf_ won’t be.

Repeat in the same way to set up thresholds for each page you want to optimise for.

 * Note that `ww-btf-tablet` is not implemented in this version and will be treated
   as `ww-btf-mobile`

#### Notes

**Note 1 — Set a browser to a specific resolution** I suggest using Chrome with 
Developer Tools enabled (right click, select _Inspect_). Resizing the window with
a mouse shows the window size next to the cursor.
 **Note 2 — Add a custom class
to a Divi module** Edit the module and select the _Advanced_ tab and use _CSS ID&
Classes_ **Note 3 —** Tablet devices are not implemented in this plugin version 
and will be treated as if they were `ww-btf-mobile`

### Divi BUG

In addition, this plugin fixes a code bug in Divi relating to the lazy loading of
images. (introduced in 4.5.2 and still present in 4.27.6)

The problem occurs in

    ```
    Divi\includes\builder\core.php @ line #63
    ```

– the remove_filter() call quietly fails because the priority is not specified. 
This bug results in the WordPress media counting logic to be run twice which defeats
the lazy-load threshold when using Divi.
 The WordPress function remove_filter()
specifies parameter 3 as `int $priority = 10`. If the priority is not 10 (in this
case it is actually 12), the remove_filter call fails.

I guess Elegant Themes’s priority are now with version 5 so this bug may not ever
get fixed. If the bug ever gets fixed, this bugfix part of this plugin will have
no effect.

This bugfix is distinct from and will work independently from the custom setting
of the custom classes described above.

**Note:** I contacted Elegant Themes about the bug and was advised to use the plugin:
[“Disable Lazy Loading”](https://wordpress.org/plugins/disable-lazy-loading/)
 which
does an excellent job of disabling **ALL** lazy loading. In this case though, this
is not the behaviour I want.

My motivation for writing this plugin is to improve the Google PSI score on Mobile
and Desktop devices.

I welcome helpful comments and suggestions 🙂

This plugin will have no effect if used on Divi < 4.5 or on WordPress < 5.7.0

## Screenshots

[⌊Above The Fold image loading without plugin - Atf image being lazy loaded => BAD⌉⌊
Above The Fold image loading without plugin - Atf image being lazy loaded => BAD⌉[

Above _The Fold_ image loading without plugin – Atf image being lazy loaded => **
BAD**

[⌊Above The Fold image loading with plugin enabled - aft image not lazy loaded⌉⌊
Above The Fold image loading with plugin enabled - aft image not lazy loaded⌉[

Above _The Fold_ image loading with plugin enabled – aft image **not** lazy loaded

## Installation

Lazy Load Fix For Divi just as you would any other WP Plugin:

 1. [Download Lazy Load For Divi](https://wordpress.org/plugins/lazy-load-fix-for-divi)
    from WordPress.org.
 2. Unzip the .zip file.
 3. Upload the Plugin folder (lazy-load-fix-for-divi/) to the wp-content/plugins folder.
 4. Go to [Plugins Admin Panel](https://codex.wordpress.org/Administration_Panels#Plugins)
    and find the newly uploaded Plugin, “Lazy Load Fix for Divi” in the list.
 5. Click Activate Plugin to activate it.

## FAQ

### Will this Plugin work on my WordPress.com website?

Sorry, this plugin is available for use only on self-hosted (WordPress.org) websites.

### Can I use this plugin with the Divi Builder

This plugin has only been tested with the Divi Theme to date. It may work with Divi
Builder using a different theme. Please do let me know how that goes 🙂

### What Divi settings should I use

This is a performance tweak plugin. It is only effective if Divi’s performance options
are ENABLED, and in particular Critical CSS **must** be ENABLED for this plugin 
to have any effect. (This is the Divi default)

### Will this work on Divi 5?

No. Divi 4 only please.

### How do I use this plugin?

Install and activate. Add custom classes as per description. That’s it!

### How to uninstall the plugin?

Simply deactivate and delete the plugin. It will clean up nicely and leave no trace.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Lazy Load Fix for Divi” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ jerrystewart99 ](https://profiles.wordpress.org/jerrystewart99/)

[Translate “Lazy Load Fix for Divi” into your language.](https://translate.wordpress.org/projects/wp-plugins/lazy-load-fix-for-divi)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/lazy-load-fix-for-divi/),
check out the [SVN repository](https://plugins.svn.wordpress.org/lazy-load-fix-for-divi/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/lazy-load-fix-for-divi/)
by [RSS](https://plugins.trac.wordpress.org/log/lazy-load-fix-for-divi/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1.2

Tested up to 7.0

#### 1.1.1

Tested up to 6.9

#### 1.1

Added ability to set _The Fold_ per page, per device

#### 1.0

Inital Release – Divi bugfix only

## Meta

 *  Version **1.1.2**
 *  Last updated **1 month ago**
 *  Active installations **50+**
 *  WordPress version ** 5.7.0 or higher **
 *  Tested up to **7.0**
 *  PHP version ** 7.0 or higher **
 * Tags
 * [above-the-fold](https://wordpress.org/plugins/tags/above-the-fold/)[divi](https://wordpress.org/plugins/tags/divi/)
   [image](https://wordpress.org/plugins/tags/image/)[lazy](https://wordpress.org/plugins/tags/lazy/)
   [lazy load](https://wordpress.org/plugins/tags/lazy-load/)
 *  [Advanced View](https://wordpress.org/plugins/lazy-load-fix-for-divi/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/lazy-load-fix-for-divi/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/lazy-load-fix-for-divi/reviews/)

## Contributors

 *   [ jerrystewart99 ](https://profiles.wordpress.org/jerrystewart99/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/lazy-load-fix-for-divi/)