Taze Logo
PerformanceMarch 26, 2026

Why Google Doesn't Like Your Site: The Practical Guide to Improving Your Core Web Vitals Scores

Why Google Doesn't Like Your Site: The Practical Guide to Improving Your Core Web Vitals Scores

Is your PageSpeed Insights score in the red? Is your Google ranking dropping? Are your users complaining about slowness? In this guide, we break down the three critical metrics that determine your site's fate (LCP, INP, CLS) and provide practical, actionable solutions to get your scores into the green.

Introduction: The Shame of the Red Score

Every developer has been there. You paste the website you proudly built into Google PageSpeed Insights, and seconds later, you're faced with that brutal red color: Performance: 35. Users complain that your site loads slowly, your Google ranking is mysteriously dropping, and no matter what you do, that score just won't turn green. Welcome to 'Core Web Vitals Hell'.

High performance scores on Google PageSpeed Insights
Our goal: Not just green scores, but bright green scores.

But this is not your destiny. Whether Google 'likes' or 'dislikes' your site isn't arbitrary. It's based on three concrete, understandable, and most importantly, optimizable core metrics that measure user experience: the Core Web Vitals. This guide will be your practical roadmap out of this hell and into the safe green zone.

Part 1: Know Your Enemy - The Three Horsemen of Core Web Vitals

Google measures user experience along three main axes: loading speed, interaction speed, and visual stability.

1. LCP (Largest Contentful Paint)

What is it? The time it takes for the largest text block or image in the viewport to load. It answers the user's question, "Is this site actually loading?"
Target: Under 2.5 seconds.

2. INP (Interaction to Next Paint)

What is it? The time from when a user interacts with your site (like clicking a button or typing in a form) to the moment the screen provides visual feedback to that interaction. It measures how 'responsive' your site feels. (Note: INP has replaced the old FID metric).
Target: Under 200 milliseconds.

3. CLS (Cumulative Layout Shift)

What is it? It measures the total of all unexpected layout shifts that occur during the page's entire lifecycle. The most frustrating example of CLS is when you're about to click a button, but an ad loads above it, shifting the button down and causing you to click something else entirely.
Target: Below 0.1.

Part 2: The Battle Plan - The Art of Optimizing Metrics

Let's now go through how to turn each metric green, step-by-step, with code examples.

Conquering LCP: Loading Performance

  • Image Optimization: The biggest enemy of LCP is large, unoptimized images.
    <!-- WRONG -->
    <img src="hero.jpg" alt="...">
    
    <!-- RIGHT -->
    <img src="hero.webp" 
         srcset="hero-480w.webp 480w, hero-800w.webp 800w"
         sizes="(max-width: 600px) 480px, 800px"
         alt="..." loading="lazy" width="800" height="450">
    What did we do? We used a modern format (WebP/AVIF), provided different images for different screen sizes (srcset), told the browser which image to choose (sizes), and used 'lazy loading' for below-the-fold images.
  • Eliminate Render-Blocking Resources: CSS and JavaScript files can block the browser from painting the page.
    <!-- CSS -->
    <!-- Load non-critical CSS asynchronously -->
    <link rel="stylesheet" href="style.css" media="print" onload="this.media='all'">
    
    <!-- JavaScript -->
    <!-- Move scripts to the end of the body or use defer/async -->
    <script src="main.js" defer></script>
  • Reduce Server Response Time (TTFB): Speed up your server's initial response with good hosting, a CDN, and server-side caching.

Taming INP: Interaction Speed

  • Break Up Long JavaScript Tasks: A single large JavaScript function that occupies the browser's main thread for too long will completely freeze your site.
    // WRONG: Anything longer than 50ms is dangerous.
    function myLongTask() {
      for (let i = 0; i < 1000000000; i++) { /* ... heavy computation ... */ }
    }
    
    // RIGHT: Break the task into smaller chunks to let the browser breathe.
    function myChunkedTask(i = 0) {
      if (i > 1000000000) return;
      
      for (let j = 0; j < 100000; j++) { /* ... a small chunk of work ... */ }
    
      // Run the next chunk when the browser is idle.
      setTimeout(() => myChunkedTask(i + 100000), 0);
    }
  • Prevent Unnecessary Re-renders: In libraries like React, use React.memo, useMemo, and useCallback to prevent components from re-rendering unnecessarily.
  • Use Web Workers: Offload very heavy, non-UI-related computations (data processing, analytics, etc.) to a Web Worker running in the background, freeing up the main thread entirely.

Eliminating CLS: Visual Stability

  • Set Dimensions on Images and Iframes: This is the #1 cause of CLS. The browser needs to know how much space to reserve for media before it loads.
    <!-- WRONG -->
    <img src="logo.png">
    
    <!-- RIGHT -->
    <img src="logo.png" width="200" height="50" style="aspect-ratio: 200/50;">
    Using aspect-ratio in CSS ensures the aspect ratio is maintained even if the image is responsive.
  • Reserve Space for Dynamic Content: For a banner, an ad, or a notification box that will be loaded from an API, reserve space for it beforehand with a skeleton or a minimum height (min-height).
    .ad-banner-placeholder {
      min-height: 90px;
      background-color: #f0f0f0;
    }
  • Optimize Font Loading: When web fonts load, the system font is often shown first, then replaced by the web font, causing a shift. Using font-display: swap; in CSS and preloading fonts (preload) can reduce this effect.

Conclusion: Performance is a Culture, Not a Destination

Congratulations! You now know how to tame the three horsemen of Core Web Vitals. Remember, performance optimization is not a one-time project. It's a culture you need to consider at every stage of your project's lifecycle. When adding a new feature, ask yourself: "Will this affect LCP? How much will this occupy the main thread? Could this cause a layout shift?". When you start asking these questions, you've taken the most important step towards creating a fast, fluid, and delightful web experience that not only Google loves, but your users will too.