Core Web Vitals: How to Pass Google's Performance Test
Master LCP, INP, and CLS metrics to pass Core Web Vitals and improve your search rankings. Practical fixes for each metric.
· 3 min read
In this article6 sections
What Are Core Web Vitals?
Core Web Vitals are Google's set of metrics that measure real-world user experience on your website. They directly affect your search rankings, and Google has been increasingly transparent about this. There are three metrics you need to pass:
- LCP (Largest Contentful Paint): How quickly the main content loads. Target: under 2.5 seconds.
- INP (Interaction to Next Paint): How responsive your page is to user input. Target: under 200 milliseconds.
- CLS (Cumulative Layout Shift): How much the page layout jumps around while loading. Target: under 0.1.
Measuring Your Current Scores
Use PageSpeed Insights to check your scores. It shows both lab data (simulated) and field data (real user measurements from Chrome). Field data matters more for rankings because it reflects actual user experience.
Also check the Core Web Vitals report in Google Search Console. It shows which pages pass, need improvement, or fail, grouped by similar URL patterns so you can fix issues systematically.
Fixing LCP: Make Your Main Content Load Fast
LCP measures when the largest visible element finishes rendering. This is usually your hero image, a large heading, or a video poster image.
Optimize Your LCP Element
If your LCP element is an image, make sure it uses modern formats (WebP or AVIF), proper sizing with srcset, and has fetchpriority="high" set. Do not lazy-load your LCP image as that delays it.
Eliminate Render-Blocking Resources
CSS and JavaScript in your document head block rendering until they download and parse. Inline critical CSS directly in the HTML, defer non-critical CSS, and add async or defer to script tags.
Use a CDN
Serving your content from a CDN like Cloudflare or Fastly reduces latency by delivering files from servers close to your users. This can cut hundreds of milliseconds off LCP for users far from your origin server.
Fixing INP: Make Your Page Responsive
INP replaced FID in March 2024 and is harder to pass because it measures all interactions, not just the first one. Common causes of poor INP:
- Long-running JavaScript that blocks the main thread
- Large DOM sizes that make updates slow
- Event handlers that trigger expensive re-renders
Break Up Long Tasks
JavaScript tasks longer than 50ms block user interactions. Use requestIdleCallback or setTimeout to break expensive operations into smaller chunks that yield to the browser between iterations.
Reduce DOM Size
Pages with more than 1,400 DOM nodes can struggle with INP. Simplify your HTML structure, remove unnecessary wrapper elements, and use virtual scrolling for long lists.
Fixing CLS: Stop Layout Shifts
Layout shifts happen when visible elements move after the page starts rendering. The most common causes:
- Images and iframes without explicit width and height attributes
- Dynamically injected content above existing content
- Web fonts causing text to reflow when they load
- Ads or embeds that resize after loading
Reserve Space for Dynamic Content
Always set explicit dimensions on images, videos, and iframes using width and height attributes or CSS aspect-ratio. This tells the browser how much space to reserve before the content loads.
Font Loading Strategy
Use font-display: optional or font-display: swap with size-adjust to minimize font-related layout shifts. Preload your most important font files with link rel="preload" to reduce the time between fallback and web font rendering.
Continuous Monitoring
Passing Core Web Vitals is not a one-time achievement. Monitor your scores continuously with tools like web-vitals JavaScript library, real user monitoring (RUM) services, or the CrUX API. Set up alerts when scores drop so you can catch regressions early.
- Core Web Vitals
- Performance
- SEO

Written by Pontus Henriksson
Co-founder and CEO of Walldy in Sundsvall. I have built for the web since I was fourteen, tested games for studios like Netflix and Bungie since 2021, and write about what I use in real projects.
Liked this? Get the next one.
New Claude skills, kits and what I learn building AI for small businesses. Not often, only when it is worth sending. Unsubscribe with one click.