WPSurfer.com

My War Against INP Speed Issues [ 100% SOLVED]

Published on June 6, 2024 | Updated on October 23, 2024

Optimizing your site for core web vitals was a piece of cake even for sites using all types of ads.

I always got away with it and passed CWV reports until Interaction to Next Paint (INP) became a new metric.

All INP issues my sites are getting have to do with the mobile experience. Desktop has never been an issue.

According to Google Search Console, I am getting 212 ms on Mobile (Group INP) and that should be less than 200ms if you want to pass Core Web Vitals Now.

At first, I said to myself that I wasn’t fixing sh*t but then I thought that I should if that’s a tiny SEO factor or something.

I thought that fixing a tiny thing here and there would solve the speed issue but the task became more difficult that I anticipated.

After applying several changes, I was able to pass Core Web Vitals on Mobile


What Have I Done So Far

I use a few plugins and services to keep everything as easy and light as possible.

#1Advanced Custom Fields
#2Cache Enabler
#3GenerateBlocks
#4CloudFlare
#5Ad Inserter
#6H5P

The services I use are:

#1CloudFlare
#2Digital Ocean via Cloudways

I did quite a few things these past few days to optimize my site using GeneratePress.

  • I optimized the core block library at first but that inlined CSS at the footer so I removed it completely and wrote CSS for the WordPress Core Blocks I am using. I added that custom CSS to a custom external stylesheet.
  • I stopped lazy loading ads with Ad Inserter Pro so I didn’t have to rely on Ad Inserter kinda heavy library. I still use Ad Inserter but not features that add any inline or external scripts.
  • I also removed Google Ad Manager ads since these ads weren’t really beating Adsense.
  • I removed an H5P style that was being loaded everywhere on the site despite not being needed on most pages and posts.
  • I removed the GP Mobile Menu because I thought that a bunch of menu links on mobile wasn’t a good experience at all. Then I opted for creating a custom header and an overlay menu for both Desktop and Mobile
  • I created a programmable search engine instead and added it to the overlay menu so I don’t have to deal with customizing search forms, the search-results page and no-search-results page. My site doesn’t load any scripts related to the GeneratePress search modal.
  • I removed all GeneratePress stylesheets and enqueued a custom stylesheet that make everything look like it used to.
  • The HTML of my sites hasn’t been any cleaner.

Finally I ended up with no more than 7 requests loading mostly everywhere on the site:

OrderRequest
#1HTML File
#2Custom Stylesheet
#3Scripts to Delay Scripts
#4Logo Image
#5Google Analytics (Delayed)
#6Adsense

There are a few pages in which H5P styles and scripts are being loaded.

However all the scripts are being delayed and the styles don’t load before more important requests

These are the number of scripts and Styles added by H5P

OrderRequest
#7HP5 style #1
#8HP5 style #2
#9HP5 style #3
#10H5P script #1
#11H5P script #2
#12H5P script #3
#13H5P script #4
#14H5P script #5
#15H5P script #6
#16H5P script #7
#17H5P script #8
#18H5P script #9

Are Ads the Real Problem?

I wanted to do my best to optimize the site and see if those other issues could fix the problem.

Also:

  • I didn’t really like the idea of delaying ads for Desktop and Mobile users because Desktop is just simply fine.
  • Debug Bear kept telling that the possible problem could be related to an (1) menu icon, (2) search Icons (3) buttons

Perfmatters provided a guide indicating that ads could be the main reason why sites were experiencing INP issues:

We’ve seen a big correlation with high total blocking time (TBT) resulting in higher INP values. So sometimes it can help to track down the biggest contributors to TBT. Many sites that are running ad networks like Google Adsense, Raptive (AdThrive), BlogHer, Mediavine, etc., typically have higher TBT. We recommend reaching out to them to see what they are doing to best optimize for INP.

How to optimize Interaction to Next Paint (INP) in WordPress

I don’t really know if delaying ads solved the issue or if it was the combination of several of the optimizations implemented over the past three months.

But It gotta be the ads when you have a super lightweight theme not loading any scripts and whose CSS have been extremely purified.

According to Google Page Speed Insights, I barely got it below 200ms

Proof that I fixed INP issues

Hopefully I won’t deal with these type of speed issues again.


Manuel Campos

Manuel Campos

I am José Manuel. I am writing about things I know and things that I am learning about WordPress. I hope you find the content of this blog useful.