In this post we will use Ad Inserter to fix the CLS issues caused by Adsense Ads in WordPress Sites.
A common trick that people use to optimize sites using Adsense ads is delaying the execution of the script using plugins such WP-Rocket, PerfMatters or Flying Scripts.
That trick doesn’t really fix CLS issues and help your site pass Core Web Vital because the data collected in Google Search Console is field data
To fix your CLS issues caused by Adsense, you need to make sure that the ads don’t push elements of the page and I will tell you how.
Fix Adsense CLS Issues with Ad Inserter
This is what I did to fix the CLS issues caused by Adsense ads.
The first thing I did was to stop using responsive ads, Google Adsense indicates that these ads make you more money, I took a chance and I kept getting good results.
It is a risk that you gotta take. Go to overview and then to global settings and turn off the option that lets Google optimize the size of your mobile ads
Now you have to go to your existing units and make sure that they have fixed size. I recommend using 300×250 for in-content ads and 300×600 for sidebar ads because those work well in Desktops, Tablets and Mobile Phones.
To do that go to your Adsense Panel, then to Overview and then to “By Ad Unit”, look for the Display Ad Unit that you want to modify and click on the pen icon next to it.
When the ad opens, go to “Ad Size” and choose Fixed instead of responsive and set the height and width you want.
I recommend the highest performing ad units, I will stick to the ones I mentioned earlier.
Copy the code and paste in a block of the Ad Inserter Plugin, choose misc and then go to display and add the width and height so the space for that ad is reserved and doesn’t push down content.
Save the changes and make sure test and see if the CLS issues by running some test in Google Page Insights.
If the CLS issue is solved, remember that this optimization will take 28 days to be validated in Google Search Console.
You can check every two or three days to see if things are going well.
Remember to do these things:
- Test, Test and Test again to make sure everything is right.
- If you are delaying the execution of the adsense JS, stop that while you are doing the test so you can get more accurate results. Visitors will see ads. You have to test your speed taking that into consideration.
- Fixed adsense units make your site look better, If visitors have a good experience while reading your post, they might read it all, see more ads and come back for more.
- Monitor your earnings in Adsense, you can try using fixed units above the fold and use responsive units below the fold and see what happens.
If this post helped you to make your site secure and faster, you can buy a coffee to a fellow blogger by clicking the button below: