WordPress sites with Adsense on shared hosting can load within 2 seconds on Mobile devices

Starblazer

Elite Member
Jr. VIP
Joined
Feb 28, 2019
Messages
7,441
Reaction score
7,895
Adsense is a performance killer for Wordpress sites. One of my websites on shared hosting used to take over 10 seconds to load on mobile devices. I tried everything but Adsense doesn't allow site to load until the ads are loaded. The latest Adsense code cut the loading speed by half. It combined 2 js scripts into one and reduced clutter. After changing this code, my site started loading within 4-5 seconds. I'm already happy with the progress as this is enough for me.

I recently checked this thread by @Mr Positive which explains performance improvements by delaying js code. I didn't update WP-rocket since a long time as I don't bother much about updates. But I wanted to try this option and updated to latest version. This option further reduced my loading speed to 2-3 seconds. You can check the current stats below:

pagespeed-report.JPG

This is mobile speed test from Google page speed insights. The mobile score is 84 and desktop score is 87. It's difficult to get 100 as my initial server response time is high.

gtmetrix-report.JPG

This is GT-metrix report. The performance didn't reach 100% due to CLS.

pingdom-report.JPG

This is pingdom report. The score is not A because I'm using Brotli and Pingdom needs Gzip. Brotli is better than Gzip, so it's better to ignore this score.

I'm using WP-rocket version 3.9.1.1 and Cloudflare free plan. The following are my settings on WP-rocket:
  • Cache - Separate cache files for mobile devices
  • File Optimization - Minify CSS files, and Optimize CSS delivery
  • File Optimization - Minify JS files, Load JS deferred, and Delay JS execution
  • Media - Lazy load for images (exclude your logo and favicon), and Add missing dimensions for images
You can use other options depending on your requirements, but these are the most powerful features of WP-rocket. You should also check your site whenever you make changes to File Optimization. As it deals with scripts, these changes could break your site.

Now you don't need a VPS just because Adsense is slowing down your site. WP-rocket can get you better performance even on shared hosting.
 
Delaying JS code execution should be done by any website that earn from ADS.
You don't want you visitor to see the first thing on the website your ads, you want them to have your whole page loaded and as they scroll down they see the ads.
 
Install Slim Seo, and Perfmatter uninstall all extra script you’ll load under a second. Just keep an eye on your revenue this is a good step as all other ad providers will follow suit.
 
Lazy loading the ads will cause a revenue drop most of the time,
Test and check how it goes then you can decide based on that,
for a website that rely mainly for ads earnings, it's not really worth the shot
 
Back
Top