Title: Native Lazyload
Author: Felix Arntz
Published: <strong>5 setembre 2019</strong>
Last modified: 6 decembre 2019

---

Search plugins

![](https://ps.w.org/native-lazyload/assets/banner-772x250.png?rev=2151732)

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/native-lazyload/assets/icon-256x256.png?rev=2151732)

# Native Lazyload

 Per [Felix Arntz](https://profiles.wordpress.org/flixos90/)

[Download](https://downloads.wordpress.org/plugin/native-lazyload.1.0.2.zip)

 * [Details](https://oci.wordpress.org/plugins/native-lazyload/#description)
 * [Reviews](https://oci.wordpress.org/plugins/native-lazyload/#reviews)
 *  [Installation](https://oci.wordpress.org/plugins/native-lazyload/#installation)
 * [Development](https://oci.wordpress.org/plugins/native-lazyload/#developers)

 [Support](https://wordpress.org/support/plugin/native-lazyload/)

## Descripcion

Lazy-loads media using the native browser feature. [Learn more about the new `loading` attribute](https://web.dev/native-lazy-loading)
or [view the WordPress core ticket](https://core.trac.wordpress.org/ticket/44427)
where inclusion of a similar implementation in WordPress core itself is being discussed.

If the `loading` attribute is not supported by the browser, the plugin falls back
to a JavaScript solution based on `IntersectionObserver`. For the case that JavaScript
is disabled, but the `loading` attribute _is_ supported by the browser, a `noscript`
variant of the respective element will be added that also includes the `loading`
attribute without any further changes.

#### « Native » means « Fast »

If you have found your way over here, you are probably aware of how crucial performance
is for a website’s user experience and success. You might also know that lazy-loading
is a key feature to improve said performance. However, the solutions for lazy-loading
so far still added a bit of overhead themselves, since they relied on loading, parsing
and running custom JavaScript logic, that may be more or less heavy on performance.

This plugin largely does away with this pattern. It relies on the new [`loading`](https://github.com/whatwg/html/pull/3752)
attribute, which makes lazy-loading a native browser functionality. The attribute
is already supported by Chrome, and will be rolled out to other browsers over time.
The solution being « native » means that it does not rely on custom JavaScript logic,
and thus is more lightweight. And « more lightweight » means « faster ».

Last but not least, a neat thing to keep in mind is that this plugin will essentially
improve itself over time, as more browsers roll out support for the `loading` attribute.

#### Usage

Just activate the plugin, and all your images and iframes in post content will be
loaded lazily.

### Credit

This plugin is partly based on logic from [WP Rig](https://github.com/wprig/wprig/blob/v2.0/inc/Lazyload/Component.php)
as well as recommendations from [web.dev](https://web.dev/native-lazy-loading) and
[developers.google.com](https://developers.google.com/web/fundamentals/performance/lazy-loading-guidance/images-and-video/).

## Installacion

 1. Upload the entire `native-lazyload` folder to the `/wp-content/plugins/` directory
    or download it through the WordPress backend.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.

## FAQ

  Where are the plugin’s settings?

This plugin does not have a settings screen. Just by activating it, the plugin will
work.

  How can I prevent an image or iframe from being loaded lazily?

You can add a class `skip-lazy` to indicate to the plugin you would like to skip
lazy-loading for this image or iframe.

  This plugin still loads an extra JavaScript file! I don’t want that.

This is perfectly fair. Note that the plugin only loads the JavaScript file as a
fallback for when the user’s browser does not support the native `loading` attribute
yet. The file includes logic to still autoload the image in a non-native way. If
you prefer to purely rely on the `loading` attribute and not provide any fallback,
you can easily disable it by adding a line `add_filter( 'native_lazyload_fallback_script_enabled','
__return_false' )` somewhere in your site’s codebase.

  Does this work with AMP?

If you use AMP, you don’t actually need this, since AMP intelligently lazy-loads
media out of the box. Still, the plugin is built in a way that it will not break
AMP compatibility, just to make sure.

  Where should I submit my support request?

For regular support requests, please use the [wordpress.org support forums](https://wordpress.org/support/plugin/native-lazyload).
If you have a technical issue with the plugin where you already have more insight
on how to fix it, you can also [open an issue on Github instead](https://github.com/GoogleChromeLabs/wp-native-lazyload/issues).

  How can I contribute to the plugin?

If you have some ideas to improve the plugin or to solve a bug, feel free to raise
an issue or submit a pull request in the [Github repository for the plugin](https://github.com/GoogleChromeLabs/wp-native-lazyload).
Please stick to the [contributing guidelines](https://github.com/GoogleChromeLabs/wp-native-lazyload/blob/master/CONTRIBUTING.md).

You can also contribute to the plugin by translating it. Simply visit [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/native-lazyload)
to get started.

## Reviews

![](https://secure.gravatar.com/avatar/e4011e7249347c4d2f90d9ad1f9243f8378a959b401ef56d32b62949f88e3029?
s=60&d=retro&r=g)

### 󠀁[It lazy loads my popups](https://wordpress.org/support/topic/it-lazy-loads-my-popups/)󠁿

 [othman19](https://profiles.wordpress.org/othman19/) 26 julhet 2022

How can I unable the lazy loading of my popups ?

![](https://secure.gravatar.com/avatar/d7965194ca94e04fb0eeddcec2bf968cb57cf25c2e5961a5e5e6f0ff04d3a646?
s=60&d=retro&r=g)

### 󠀁[Google update your products PLEASE](https://wordpress.org/support/topic/google-update-your-products-please/)󠁿

 [NikosTsolakos](https://profiles.wordpress.org/nikostsolakos/) 17 febrièr 2022

Im really happy that Google is creating plugins for our projects BUT keep them up-
to-date please… you’re the God of the internet, a trillion dollar company.

![](https://secure.gravatar.com/avatar/9c4928edc97c7bc1fbcc1caa39bd7a7de114a2f6620881da4bbf773ac9593f98?
s=60&d=retro&r=g)

### 󠀁[Native lazy loading – the only viable lazy loading solution](https://wordpress.org/support/topic/native-lazy-loading-the-only-viable-lazy-loading-solution/)󠁿

 [bloup](https://profiles.wordpress.org/bloup/) 31 decembre 2020

This plugin adds loading= »lazy » and then, the browser lazy loads the image. I 
think that native lazy loading performed by the browser is the only viable solution
for lazy loading. For many years, I tried to implement lazy loading on my websites.
I faced many issues. Once images were not crawled. Once my website was penalized
because of cloaking. Versions differed depending on the client. I am enough with
javascript scripts that slow down the pageload and negatively impact the pagespeed
insight. I think that for now and in the future, the native lazy loading is the 
only way to go for lazy loading.

![](https://secure.gravatar.com/avatar/a2bfa339f76b644688ceeb68a138f6784ce3e2ba6eaf304b88c6ea18d18574a5?
s=60&d=retro&r=g)

### 󠀁[Broken on safari](https://wordpress.org/support/topic/broken-on-safari/)󠁿

 [gkwebph](https://profiles.wordpress.org/gkwebph/) 13 Agost 2020

Hey guys – Can you please fix this in the latest Safari. Thanks!

![](https://secure.gravatar.com/avatar/8716627bd2260286260e22f120e6d154cded64c8126c75efab34e9070f9ca72f?
s=60&d=retro&r=g)

### 󠀁[It does not improve my sites](https://wordpress.org/support/topic/it-does-not-improve-my-sites/)󠁿

 [havig](https://profiles.wordpress.org/havig/) 27 febrièr 2020

First, did not break my site and it did lazyload most of the page images. It does
not lazyload images if they are served from a different host. Example, unbounce,
etc. I will add another caveat, all of my images and their versions are always carefully
resized and highly compressed. Checked with lighthouse and my score took a hit downwards.
13 points down on performance score. I tested on my Staging area, uncached. FCP 
went from 2.1s to 4.2s, all of the other metrics, including time to interactive,
CPU idle, speed index and First Meaningful Paint took a dive. I will chuck this 
to I was already hyperoptimized and lazy loading is not truly needed on my site/
s. But I would advise others to try it out (not on their live site) and test speed
with Google Lighthouse before and after.

![](https://secure.gravatar.com/avatar/802f32777dc7405045f0e0b4f46413e12e9dacbd09aef8660f1b9bf026266864?
s=60&d=retro&r=g)

### 󠀁[Does what it says](https://wordpress.org/support/topic/does-what-it-says-876/)󠁿

 [shawn caza](https://profiles.wordpress.org/shawncaza/) 17 febrièr 2020

Seems to work well. On browsers that don’t support lazy loading, it doesn’t seem
to load the images as soon as I would like. As in there can be a bit of a delay 
between scrolling and the image appearing on screen. Not to bad though. Not going
to worry about it as native image loading is the way of the future and will be implemented
into more browsers.

 [ Read all 31 reviews ](https://wordpress.org/support/plugin/native-lazyload/reviews/)

## Contributors & Developers

“Native Lazyload” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Felix Arntz ](https://profiles.wordpress.org/flixos90/)
 *   [ Google ](https://profiles.wordpress.org/google/)

“Native Lazyload” has been translated into 17 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/native-lazyload/contributors)
for their contributions.

[Translate “Native Lazyload” into your language.](https://translate.wordpress.org/projects/wp-plugins/native-lazyload)

### Interested in development?

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

## Changelog

#### 1.0.2

 * Fix broken images which are using data URI scheme (e.g. base64-encoded images).
   Props [ieim](https://github.com/ieim).
 * Fix images in IE 11 not being loaded until the user starts scrolling. Props [Soean](https://github.com/Soean).
 * Fix image loading script not working in IE10 and other browsers that do not support`
   dataset`.

#### 1.0.1

 * Improve compatibility with other plugins by using more specific class and only
   adding it for JS fallback.
 * Run lazy-load script on `DOMContentLoaded` when necessary to improve compatibility
   with plugins like Autoptimize.
 * Do not transform elements inside an AJAX response due to lack of predictability
   of the context and script execution.

#### 1.0.0

 * Initial release

## Mèta

 *  Version **1.0.2**
 *  Last updated **6 annadas ago**
 *  Active installations **6 000+**
 *  WordPress version ** 4.7 or higher **
 *  Tested up to **5.3.21**
 *  PHP version ** 7.0 or higher **
 *  Languages
 * [Chinese (Taiwan)](https://tw.wordpress.org/plugins/native-lazyload/), [English (UK)](https://en-gb.wordpress.org/plugins/native-lazyload/),
   [English (US)](https://wordpress.org/plugins/native-lazyload/), [French (France)](https://fr.wordpress.org/plugins/native-lazyload/),
   [German](https://de.wordpress.org/plugins/native-lazyload/), [Italian](https://it.wordpress.org/plugins/native-lazyload/),
   [Japanese](https://ja.wordpress.org/plugins/native-lazyload/), [Lithuanian](https://lt.wordpress.org/plugins/native-lazyload/),
   [Norwegian (Bokmål)](https://nb.wordpress.org/plugins/native-lazyload/), [Portuguese (Brazil)](https://br.wordpress.org/plugins/native-lazyload/),
   [Portuguese (Portugal)](https://pt.wordpress.org/plugins/native-lazyload/), [Russian](https://ru.wordpress.org/plugins/native-lazyload/),
   [Spanish (Chile)](https://cl.wordpress.org/plugins/native-lazyload/), [Spanish (Spain)](https://es.wordpress.org/plugins/native-lazyload/),
   [Spanish (Venezuela)](https://ve.wordpress.org/plugins/native-lazyload/), [Swedish](https://sv.wordpress.org/plugins/native-lazyload/),
   [Ukrainian](https://uk.wordpress.org/plugins/native-lazyload/) e .[Vietnamese](https://vi.wordpress.org/plugins/native-lazyload/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/native-lazyload)
 * Tags
 * [lazy](https://oci.wordpress.org/plugins/tags/lazy/)[lazyload](https://oci.wordpress.org/plugins/tags/lazyload/)
   [load](https://oci.wordpress.org/plugins/tags/load/)[loading](https://oci.wordpress.org/plugins/tags/loading/)
   [native](https://oci.wordpress.org/plugins/tags/native/)
 *  [Advanced View](https://oci.wordpress.org/plugins/native-lazyload/advanced/)

## Ratings

 3 out of 5 stars.

 *  [  12 5-star reviews     ](https://wordpress.org/support/plugin/native-lazyload/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/native-lazyload/reviews/?filter=4)
 *  [  4 3-star reviews     ](https://wordpress.org/support/plugin/native-lazyload/reviews/?filter=3)
 *  [  7 2-star reviews     ](https://wordpress.org/support/plugin/native-lazyload/reviews/?filter=2)
 *  [  8 1-star reviews     ](https://wordpress.org/support/plugin/native-lazyload/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/native-lazyload/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/native-lazyload/reviews/)

## Contributors

 *   [ Felix Arntz ](https://profiles.wordpress.org/flixos90/)
 *   [ Google ](https://profiles.wordpress.org/google/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/native-lazyload/)