Blog
Optimize Core Web Vitals: A Step-by-Step Guide to Page Speed SEO
A practical guide to improving your website's Core Web Vitals scores with actionable steps, real examples, and common pitfalls to avoid for better SEO and user experience.

Summary
Core Web Vitals are Google's user experience metrics that directly impact your search rankings. Many site owners struggle with poor LCP, INP, and CLS scores, hurting their SEO. This article provides a concrete, step-by-step plan to optimize each metric, from image compression to code splitting. You'll learn how to measure your current performance, prioritize fixes, and avoid common mistakes like over-optimization. Real examples show before-and-after improvements. Follow these steps to boost your Core Web Vitals and climb the search results.
The Core Web Vitals Problem
Google's Core Web Vitals have become a direct ranking factor, meaning slow or janky websites get buried in search results. Yet many site owners are stuck: they see poor scores but don't know how to fix them systematically. This guide walks you through a repeatable process to optimize Largest Contentful Paint (LCP), Interaction to Next Paint (INP), and Cumulative Layout Shift (CLS). By the end, you'll have a clear action plan to improve your site's performance and SEO.
Understanding the Three Metrics
Before diving into fixes, it's critical to understand what each metric measures and why they matter:
- LCP (Largest Contentful Paint) – Measures loading performance. Ideally under 2.5 seconds. Represents the time when the main content of the page is likely visible.
- INP (Interaction to Next Paint) – Measures responsiveness. Ideally under 200 milliseconds. Captures the delay between a user interaction (click, tap) and the visual response.
- CLS (Cumulative Layout Shift) – Measures visual stability. Ideally under 0.1. Quantifies how much visible content shifts unexpectedly.
Google uses these as ranking signals, but they also directly affect user engagement. A site that loads fast, responds instantly, and doesn't jump around keeps visitors happy and converting.
Measure Before You Optimize
You can't fix what you don't measure. Start by gathering baseline data from multiple sources:
- PageSpeed Insights – Provides lab and field data for any URL. Run it on your most important pages.
- Chrome User Experience Report (CrUX) – Real-user data aggregated in PageSpeed Insights or via BigQuery.
- Lighthouse in Chrome DevTools – Offers actionable recommendations and scores.
- Web Vitals extension – See real-time metrics while browsing your own site.
Focus on the field data (real users) rather than lab data alone. Your goal is to fix actual user experiences. Note the metric values and identify the worst offenders among your pages.
Step 1: Optimize LCP – The Hero Image and Server TTFB
The most common LCP element is a hero image or large text block. Here's how to shrink LCP:
a. Compress and Modernize Images
- Use modern formats like WebP or AVIF – they offer 25-50% smaller file sizes than JPEG/PNG.
- Resize images to the maximum display size. Don't serve a 4000px image in a 1200px container.
- Use a CDN with automatic image optimization (e.g., Cloudflare, Imgix) to serve correctly sized versions.
Example: A hero image went from 500KB JPEG to 50KB WebP without visible quality loss, dropping LCP from 4.2s to 2.1s.
b. Improve Server Response Time (TTFB)
- Use a fast hosting provider with good caching (e.g., Vercel, Netlify, or a CDN-backed host).
- Implement server-side caching for dynamic pages.
- Consider a lightweight CMS or static site generator to minimize server processing.
c. Prioritize Critical Resources
<link rel="preload">the hero image to fetch it early.- Inline critical CSS for above-the-fold content to avoid render-blocking.
Step 2: Optimize INP – Tame Heavy JavaScript
INP is often ruined by long JavaScript tasks that block the main thread. To improve it:
a. Code Splitting and Lazy Loading
- Split your JavaScript bundle so only necessary code loads initially. Use
import()for routes/components. - Defer non-critical scripts with
deferorasync.
b. Break Up Long Tasks
- Use
requestIdleCallback()orsetTimeout()to chunk work into smaller pieces. - Move expensive computations to Web Workers if possible.
c. Optimize Event Handlers
- Debounce or throttle scroll and resize handlers.
- Avoid complex inline event listeners. Use event delegation where appropriate.
Example: A site with a heavy analytics script loading early increased INP to 350ms. Moving the script to after load with requestIdleCallback improved INP to 180ms.
Step 3: Optimize CLS – Prevent Layout Shifts
CLS is often the easiest to fix because it's usually caused by missing dimensions or late-loading content.
a. Set Explicit Dimensions
- Always add
widthandheightattributes to images and videos. Modern CSS can handle responsive sizing withaspect-ratio. - For dynamic ads, reserve a fixed-height container (or use a placeholder that accounts for typical ad variance).
b. Control Web Fonts
- Use
font-display: swapso text renders immediately with a fallback font while the custom font loads. - Prefer
font-display: optionalfor non-critical fonts.
c. Avoid Dynamic Injections Above Existing Content
- Insert third-party embeds (ads, widgets) only after the surrounding layout is stable, or reserve space beforehand.
Example: Adding explicit width and height to a hero image (and removing inline dimensions that were miscalculated) reduced CLS from 0.32 to 0.05 – a massive improvement.
Prioritizing Your Fixes
Not all fixes are equal in effort vs. impact. Use this priority list:
- CLS first – Often the easiest and fastest to fix. Even one dimension change can bring you under 0.1.
- LCP next – Image compression and caching can yield quick wins.
- INP last – Usually requires more architectural changes like code splitting.
Run PageSpeed Insights after each fix to measure progress. If LCP improves but INP worsens, your changes might have increased JavaScript. Always test on mobile – it's where users feel poor performance most.
Common Pitfalls to Avoid
- Over-optimizing: Don't strip all animations or ditch frameworks unnecessarily. Aim for good, not perfect.
- Ignoring the mobile experience: Optimize for the smallest screen first.
- Forgetting third-party scripts: A slow ad server can tank your metrics. Use lazy loading and asynchronous loading.
- Only looking at lab data: Field data (from CrUX) is what Google uses. If field data is poor, lab data might not reflect real conditions.
Conclusion
Core Web Vitals optimization is not a one-time task but a continuous improvement cycle. By following the steps outlined – measure, tackle CLS, compress LCP assets, and tame INP with code splitting – you can systematically improve your scores and SEO. Start today by auditing one key page and applying the three Easy Wins: set image dimensions, compress hero images, and defer non-critical JavaScript. Your users (and search rankings) will thank you.
Once you have a performance baseline, you can also consider building new pages with performance baked in from the start. Tools like Pagenza let you create a complete landing page from a plain-text description, producing clean, fast HTML without manual optimization. That's one way to ensure your next page already meets Core Web Vitals thresholds out of the box.
Sources (5)
- Google's SEO Starter Guide: What Website Teams Need to Know
- What Is Technical SEO? The Best Checklist in 2026
- Technical SEO Checklist 2026: What Really Matters - NoGood
- How Important Is Page Speed for SEO? Exploring Its Impact on Rankings - Devenup Agency
- Core Web Vitals — What they are and how to optimize them - web.dev



