An efficient lazy loader (defer.js)


WordPress remains one of the most popular CMS platform until now, and I’m excited to make a WordPress plugin that focuses on minimizing payload size of HTML document and optimizing processing on the browser when rendering the web page.

⚡️ A native, blazing fast lazy loader. ✅ Legacy browsers support (IE9+). 💯 SEO friendly. 🧩 Lazy load almost anything.

Rate 5 stars (⭐️⭐️⭐️⭐️⭐️) if you guys like it.

💡 Tip for defer.js: To archive better result, please disable lazyload and HTML-CSS-JS optimizations by other plugins.

Powered by defer.js

defer.js is a super tiny, native performance library for lazy-loading JS, CSS, images, iframes…

  • ⚡️ Native API, blazing fast
  • 👍 Legacy browsers support (IE9+)
  • 🥇 SEO friendly
  • ✅ Very easy to use
  • 💯 No dependencies, no jQuery
  • 🤝 Works well with your favorite frameworks
  • 🧩 Uses IntersectionObserver API for optimized CPU usage
  • 🏞 Supports for responsive images, both srcset and sizes attributes

Easily speed up your website!

Other lazy loading libraries hook up to the scroll event on elements that need to be lazy loaded. This approach forces the browser to re-layout the page and it is painfully slow.

Here we are, defer.js is written in plain JavaScript, making lazy-loading more efficient and fast. This library is using the recently added Intersection Observer with tremendous native performance benefits.

In various cases, using async or defer does not deliver faster page speed than defer.js does.

Browser support

Available in latest browsers. This library also works perfectly with Internet Explorer 9 and later.

  • 🖥 IE9+
  • 🖥 Firefox 4+
  • 🖥 Safari 3+
  • 🖥 Chrome *
  • 🖥 Opera *
  • 📱 Android 4+
  • 📱 iOS 3.2+

Keep in touch

Released under the GNU General Public License v2 license.

Copyright (c) 2019 Mai Nhut Tan <>


  • Scoring 100/100 in Google PageSpeed Test!
  • Defer almost anything, easily speed up your website.


  1. Upload defer-wordpress to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress


What is defer.js?

🥇 A super tiny, native performance library for lazy-loading JS, CSS, images, iframes… Defer almost anything, easily speed up your website.

Why should I lazy-load my content?

The loading of contents on web page may make your load speed more slow, no one likes staring at a blank white page; users are impatient and will leave quickly.

Lazy loading content on web page can help reduce resource contention and improve performance.


21 febrièr 2020
Just try it and you will understand me. Tested with 2 sites off mine a very heavy one and a normal one. Recommended !
23 octobre 2019
No other plugin was able to fix Defer parsing of JavaScript. Ive tried all the big name plugins. None of them worked and resolved the issue. After installing this plugin Defer parsing of JavaScript score went from 0% to 99% on Gtmetrix and improved my overall score from 74% to 86%. I use Elementor. You must disable this plugin before lunching and editing page in Elementor, otherwise you might get an error or some elements will not be displayed correctly. Not a big issue. I just disable and enable it back when im done editing. I use it in conjunction with WP Fastest Cache. Try different settings in WP Fastest Cache to achieve best result. Great plugin! A Must have!
23 octobre 2019
Excellent. The best Lazy Loader plugin. Works great.
In PHP72 Centos 7 Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/vendor/shinsenter/defer.php/src/DeferParser.php:66 Stack trace: #0 /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/vendor/shinsenter/defer.php/src/Defer.php(64): shinsenter\Defer->cleanup() #1 /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/includes/class-defer-js-activator.php(59): shinsenter\Defer->__destruct() #2 /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/shins-pageload-magic.php(126): Defer_Js_Activator::activate() #3 /var/www/lucrecia/wordpress/public_html/wp-includes/class-wp-hook.php(286): activate_defer_wordpress('') #4 /var/www/lucrecia/wordpress/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #5 /var/www/lucrecia/wordpress/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array) #6 /var/www/lucrecia/wordpress/public_html/wp-admin/ in /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/vendor/shinsenter/defer.php/src/DeferParser.php on line 66 In PHP74 RC 01/10/2019 build El plugin no ha podido activarse porque ha provocado un error fatal. El plugin no ha podido activarse porque ha provocado un error fatal. Fatal error: Uncaught Error: Call to undefined function shinsenter\mb_detect_encoding() in /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/vendor/shinsenter/defer.php/src/DeferParser.php:124 Stack trace: #0 /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/vendor/shinsenter/defer.php/src/Defer.php(98): shinsenter\Defer->parseHtml() #1 /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/includes/class-defer-js-activator.php(59): shinsenter\Defer->fromHtml() #2 /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/shins-pageload-magic.php(126): Defer_Js_Activator::activate() #3 /var/www/lucrecia/wordpress/public_html/wp-includes/class-wp-hook.php(286): activate_defer_wordpress() #4 /var/www/lucrecia/wordpress/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters() #5 /var/www/lucrecia/wordpress/public_html/wp-includes/plugin.php(465): WP_Hook->do_action() #6 /var/www/lucrecia/wordpress/public_ in /var/www/lucrecia/wordpress/public_html/wp-content/plugins/shins-pageload-magic/vendor/shinsenter/defer.php/src/DeferParser.php on line 124 No working, sorry.
16 Agost 2019
However, optimized Javascript option can cause problems for some themes. In this case, turn off that option. That's it. Oh, I think the preload option is a good option for heavy sites. It is more comfortable to turn off this option and assign it directly to the header area. We hope this plugin will continue to be supported. 👍👍
Read all 28 reviews

Contributors & Developers

“An efficient lazy loader (defer.js)” is open source software. The following people have contributed to this plugin.



1.1.11 Fixed security issue (Fixed CVE-2019-18888)

1.1.10+5 Removed external resources

1.1.10 Bug fixes and improvements

1.1.9 Fixed wrong encoding when using mb_detect_encoding() function

1.1.8 Updated defer.php library (v1.0.15)

1.1.7 Fixed issues of FireFox, code improvements

1.1.6 Updated library version, improved javascript execution order

1.1.5 Hotfix: Escape HTML node value

1.1.4 Many improvements

1.1.3 Unify lazy attributes of another plugins

1.1.2 Fixed some known issues with gtm.js, improve library’s caches

1.1.1 Small bug fixes (IE polyfill, missing meta tags, preloading ads)

1.1.0 Added settings page

1.0.9 Imrpoved preloading code

1.0.8 Fixed issues with open web fonts

1.0.7 Optimized scriptloader, polyfill, scrset

1.0.6 Small bug fixes (color placeholders, css)

1.0.5 Migrated with defer.js library

1.0.0 ~ 1.0.4 The first implement