Publisher Theme BetterStudio
English
  • العربية
  • فارسی
  • Publisher Theme
  • WP Plugins
  • Blog
    • Learn WordPress
    • Learn Marketing
    • Learn Design
    • Learn Shopify
    • Login
    • Create Account
Download Publisher
Publisher Theme <
  • Publisher WP Theme
    • Features
    • Demos
    • Showcases
    • Changelog
    • Support
    • Documentation
    • Publisher vs Others
      • Newspaper vs Publisher
      • Soledad vs Publisher
      • Jannah vs Publisher
      • Good News vs Publisher
      • JNews vs Publisher
      • MagPlus vs Publisher
      • Newsmag vs Publisher
      • SmartMag vs Publisher
      +
    +
  • Pricing
  • WP Plugins
  • Blog
  • Login
  • Create Account
Download Publisher
English
  • العربية
  • فارسی
Learn WordPress
  • All
  • WP Tutorials
  • WP Plugins
  • WP Themes
  • WP Hostings

How to Lazy Load Adsense in WordPress?

You probably have experienced Google Adsense slowing page load. To fix this issue, lazy load Google Adsense for all users.

May 6, 2019
4
lazy load google adsense

What is Adsense lazy load? Lazy loading Google Adsense is a method in which Adsense ads are loaded only after the user sees them. This solves the first and foremost problem with Google Adsense: Its very slow loading speed. Although on the downside, if your ad is not loaded, technically it has not received an impression.

See Also: Our plugin to manage Adsense in WordPress

Google Adsense is the main and most trusted ads program in the world. It helps you easily monetize your website and blog, regardless of its size, rank, or audience. It also tailor makes the ads through Google’s powerful algorithms, offering each user unique and useful products.

On the flip side, Google Adsense slows pages down. A test run by Diana Jensen of the WPBloggingNerd showed that by adding 3 Adsense banners, loading time is increased by up to 34%, the page size by 200%, and the number of requests by 400%. So in a paradoxical way, your monetization tool is also chasing your customers out of the door.

Advertising management is a critical action on your site and it directly affects how much you earn from your site or lose!

Table of Contents
Why Lazy Load Google Adsense
How to Lazy Load Adsense on WordPress
The Easy Way: Install Better Ads Manager
The Hard Way: Implement Javascript

Why Lazy Load Google Adsense

Lazy loading is a popular web design pattern. It essentially loads an object (the ad in this case) when the user gets to it by scrolling the page. So your page will stop loading after important and above-the-fold elements are finished. If the user wants to navigate more, new objects will load in real-time.

By lazy loading Google Adsense, you will take some pressure off the initial loading process. making it easier for the page to load and for users to have a quick look at the site, and take actions according to what they see. Maybe they want to click on the navigation bar. Why load the footer ad for them anyway?

How to Lazy Load Adsense on WordPress

We will offer 2 ways to lazy load Google Adsense. One is to simply use the Better Ads Manager plugin (comes alone and with Publisher theme as an extra). The second one is to add it yourself.

The Easy Way: Install Better Ads Manager

Better Ads Manager is one of the most popular WordPress ads plugins and with 120+ ad locations, Adsense Compatibility, Adblocker detector, and AMP support have the features to match its reputation.

The most recent update of Better Ads Manager comes with lazy loading Google Adsense as a default. You can enable it easily through the plugin’s options. To enable lazy loading for Adsense take the following steps:

  • In WordPress admin panel, open Better Ads options.
  • Open Ads Manager
  • Click on Lazy Loading Ads (picture above)
  • Set Lazy Load Ads? to Yes, Lazy load all Ads

That’s it!

The Hard Way: Implement Javascript

The Javascript root is a bit tougher. So if you’re not sure, leave it to an expert to do it for you. This method is courtesy of Gulshan Kumar and should work fine.

With every ad unit, comes an add code. It all includes the js code below:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

Remove the code above from all ad units.

then add the code below to your site’s footer:

<!--noptimize-->
<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>
<!--/noptimize-->
Please Share This:

4 Comments Leave a Reply

saurav singhsays:
November 6, 2021 at 7:07 pm

Great Finally I found very useful script and trick to increase page speed. Thanks a lot. By using your method I made a small script for custom website or for blogger platform website. Also Like you I shared on my website also Technical Arp Please check if you can.

Again Thanks for small but very useful method.

Reply
Nipunasays:
November 19, 2021 at 10:25 pm

This method is actually defer loading for a better performance betterstudio team must consider using LazyHTML

https://github.com/Niresh12495/LazyHTML

Reply
BetterStudio Adminsays:
December 5, 2021 at 11:14 am

Thank you for letting us know, we’ll look into it ASAP.

Reply
Ivanilton Quintosays:
January 13, 2022 at 4:59 am

Great!
Thanks for share it.

Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Publisher Theme

All-in-one WordPress Theme for Magazines, Newspapers and Blogs

WordPress Publisher Theme For Newspaper and magazine and blog Get Publisher
Content Protector

Prevent content copiers from copying your website texts, images, videos, and source code

Protect Your Content
  • Home
  • Blog
  • 📙 WordPress Tutorials
  • How to Lazy Load Adsense in WordPress?
Get the Latest Tutorials by Subscribing to Our Newsletter
Subscribe to our newsletter to be notified on new post and product releases.
BetterStudio
  • Contact us
  • Advertise
  • Custom Development Services
  • Blog
Products
  • Publisher Theme
  • Better Ads Manager
  • Our Plugins
Useful Links
  • 30 Days Refund Guarantee
  • Refund Request Form
  • BetterStudio Affiliates
  • Affiliate Payout Request
Support
  • WPShield
  • Publisher Theme
Connect
  • Follow on Twitter
  • Join us on Facebook
  • Follow on Instagram
Copyright © 2025 — BetterStudio. Terms & Conditions — Privacy Policy