How I Optimized a WordPress Site to Score 97 on Google Lighthouse
September 22, 2026Google’s PageSpeed Insights uses Lighthouse under the hood, and while a perfect score is never the goal in itself, it’s a useful proxy for “this site loads fast and doesn’t do anything annoying.” The techniques that push a site toward 100 are the same ones that meaningfully reduce bounce rate and improve Core Web Vitals — the signals Google uses for ranking. Here’s the actual sequence of changes I made on a real client project, from 54 to 97 on mobile.
Start with a real audit, not a template checklist
Before touching anything, run Lighthouse in Chrome DevTools on a throttled mobile connection (Slow 4G is the useful preset). Read the Opportunities and Diagnostics sections carefully. The order of impact varies by site — don’t apply a generic fix list. On this project, the top three opportunities were image format and sizing, render-blocking resources, and unused JavaScript. That’s what I addressed first, in that order.
Images: the single biggest win on most sites
The homepage hero was a 2.4MB JPEG uploaded at full camera resolution. After converting to WebP with Imagify and serving it at the rendered width (not full-resolution), it dropped to 340KB. Properly sizing images for their rendered dimensions and adding loading="lazy" to below-fold images contributed nearly 20 Lighthouse points on its own.
For custom image output in theme templates, using wp_get_attachment_image() instead of hardcoded img tags gets you WordPress’s native responsive image markup — srcset with multiple sizes, correct dimensions, and lazy loading — for free.
Render-blocking resources
Google fonts were loading synchronously in the head. Switching to font-display: swap in the Google Fonts URL parameters removed the render block. For plugin stylesheets that weren’t needed above the fold, I moved their load to the footer or deregistered them on pages where they weren’t used. Query Monitor is invaluable for identifying which plugin loads what on which page.
JavaScript: every plugin that loads a script globally when it only needs to be on specific pages is a performance liability. Conditional dequeuing based on is_page() or post type checks is tedious work but adds up quickly. WooCommerce scripts on a blog post, contact form scripts on the homepage — these are common culprits.
Caching properly
Full-page caching is non-negotiable. Without it, every WordPress request triggers a full PHP and MySQL cycle. With a page cache, repeat visitors get a pre-built HTML file, the same as a static site. WP Rocket handles page cache, browser cache, database optimisation, and CSS/JS minification in one panel.
Set long browser cache expiry headers for static assets. Images, fonts, and CSS that don’t change should be cached for a year or more. WordPress’s default is nothing on most hosting configurations. Adding proper Cache-Control headers either via .htaccess or through WP Rocket’s browser cache settings is a few minutes of work with real measurable impact.
The Core Web Vitals that actually moved the score
Largest Contentful Paint (LCP) — usually the hero image or main heading. For the hero image, adding fetchpriority="high" to the img tag so the browser prioritises it over other resources moved LCP from 4.1 to 1.9 seconds on its own. If your LCP element is loaded via CSS background-image, switch it to an img element — browsers can’t preload background images.
Cumulative Layout Shift (CLS) — elements moving around after page load. The most common culprits are images without explicit width/height attributes and fonts loading and swapping. Add dimensions to every image. It’s unglamorous work but it eliminates CLS almost entirely on content sites.
Interaction to Next Paint (INP) — primarily affected by heavy JavaScript on the main thread. Deferring non-critical scripts and removing plugins with large JS bundles that you don’t actually need addresses most INP issues on content sites.
Measure on Google’s PageSpeed Insights rather than local Lighthouse — mobile scores from Google’s servers reflect real-world conditions better than a throttled laptop simulation. The numbers from PSI are what actually matter for search ranking.