Best way to Lazy Lo...
 
Notifications
Clear all

Best way to Lazy Load Google ADS in Wordpress

1 Posts
1 Users
0 Reactions
11 Views
(@allseobasics)
Posts: 40
Member Admin
Topic starter
 

Hey guys, after 3 weeks of research and optimizing my website for Google Ads, I noticed the page vitals (page speed) score was being effected by ads.

Now I have tried over 100 different ways to make this work inside WordPress and trust me, it took me over 200 hours of tweaking, testing and debugging many scripts and plugins.

To make this work correctly and be within Google's terms, I have used the same strategy I had for over many years with WP-Rocket.

But using WP-Rocket only works on manual ads and not auto-ads, and this was an issue. Also, WP-Rocket is a paid plugin and has its own cache system, making it impossible to use with other caching plugins.

I came up with a better combo of using 2 plugins together to make this work!

Trust me, I have checked over 100s of pages online and none of these show this combo to make this work, and I am 100% sure this setup will help you achieve lazy loading on manual and auto Google Ads. 

 

My questions were

  • How can I lazy loads auto-ads and manual ads at same time?
  • How to make this work on any cache and optimization plugin?
  • How to make sure the ads load correctly and not slow down the page speed?
  • How to make sure that this lazy load of ads on auto and manual ads improves my page speed score?

 

What do you need to do?

First, you can use any caching plugins such as WP-fastest cache, Litespeed cache, WP super cache or any cache plugins and your lazy loading of your ads will work.

This is amazing news!!

Best part is there is no coding required. Here are my steps on making this work. 

 

Step 1

Remove any Google Ads auto-code from your WordPress blog. As the plugin we will be using will do all of this for us. This will be inside your header of your website or any scripts you have used to import your Google auto ad code.

Do not panic, we will be using an auto-plugin which will do the same. Check part 2.

 

Step 2

Now to lazy load auto-ads which are treated separately to manual ads (added by yourself), you will need to download "Lazy Load AdSense" plugin, in here all you need to do is input your "ca-pub-xxxxxxxxxxxxxxxx (replace with your publisher ID code) which you can find on your Google AdSense account.

This plugin will lazy load all your ads till user interaction, speeding up website loading times and improving page speed score, web vitals and also improving user experience.

 

Step 3

The auto-ads are now lazy loading after user interaction, but the manual ads will need to be changed to lazy load, this can be done with another WordPress plugin called "Flying Scrips" to lazy load any manual ads.

On the settings inside this plugin, you can check my screenshot below;

These setting will lazy load all manual Google Ads on your blog, websites;

lazy load google Adsense Ads settings

These settings will simply target Google AdSense keywords on your website and lazy load these for 5 seconds, improving page speed score, google web vitals, improving page speed and improving user experience. 

You can copy and paste these google keywords below;

adsbygoogle
adsbygoogle.js
google
pagead2.googlesyndication
googlesyndication
googletag.pubads
pubads
googletag
ins.adsbygoogle

 

I hope that my combination of these 2 plugins will help all WordPress bloggers and users lazy load these AdSense ads.

This combination works great for me and has sped up my website drastically.

You can also change the time of interaction for the lazy load to start, ranging from 2 seconds to never. 5 seconds seems to work great for me, but it's based on your preference.

Let me know below if I have managed to help you guys, after-all I have spent over 3 weeks searching for the right scripts.

I was very close to pulling my hair out during the research process, but I have managed to get there, there are tons of online tutorials and ways to do this, but not many of these work!

This is by far the best combination I have ever come across, and wanted to share my experience and knowledge.

Also, if you are using google page speed, allow up to 4/5 weeks for new web page speed vitals to take effects, as this could take a little bit of time, but it will have positive effects.

Love and Peace!

This topic was modified 5 days ago 4 times by Pavel Horvath
 
Posted : 13/05/2025 5:19 pm
Share: