Skip to content
Back to Blog
Performance11 min read

Core Web Vitals Optimization: 7 Fixes That Work in 2026

Practical server-side and front-end fixes to improve LCP, INP, and CLS scores—image compression, render-blocking elimination, and timing adjustments that move the needle.

Written by Abdul AbrorTechnical Hosting Support Engineer
Core Web Vitals Optimization: 7 Fixes That Work in 2026
On this page

Google's Core Web Vitals remain the gatekeepers for search ranking and user experience in 2026. LCP, INP, and CLS measure what users actually feel—load speed, responsiveness, and visual stability. Most sites I audit fail on preventable mistakes: oversized images, JavaScript chaos, and misconfigured server timing. Fix those and your scores move.

This article covers seven hosting-side and front-end changes that reliably improve Core Web Vitals. No guesswork. No caching plugins that promise magic. Just the adjustments that consistently work when I walk clients through performance audits.

1. Serve WebP and AVIF images with proper compression

Images are the heaviest assets on most pages and the single biggest drag on LCP. JPEG and PNG files from five years ago are too large for modern mobile users on metered connections.

Convert images to WebP as a baseline. AVIF offers better compression but browser support still lags slightly—use it with WebP fallback. A typical product photo that weighs 800 KB as JPEG drops to 150 KB as WebP with no visible quality loss.

For WordPress installs, I disable auto-upload of full-resolution images and run conversion at the server level. Install libwebp on your VPS:

sudo apt install webp
cwebp input.jpg -q 85 -o output.webp

Quality 85 is the sweet spot. Below 80 you see artifacts; above 90 the file size benefit fades.

If you run cPanel shared hosting, use an image optimization plugin that converts on upload—ShortPixel and Imagify both work. Check that the plugin serves <picture> tags with proper fallback:

<picture>
  <source srcset="hero.avif" type="image/avif">
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.jpg" alt="Hero image" width="1200" height="630">
</picture>

Always include explicit width and height attributes. Without them the browser can't reserve space and you'll see CLS spikes when images load.

2. Eliminate render-blocking CSS and JavaScript

Render-blocking resources delay First Contentful Paint and inflate LCP. The browser downloads your HTML, hits a <link> or <script> tag in the head, stops parsing, fetches the file, and only then continues.

Inline critical CSS directly in the <head>. Critical CSS is the minimal set of styles needed to render above-the-fold content—typically 10-15 KB. Extract it manually or use a tool like Critical or Penthouse during your build step. Everything else loads async:

<link rel="preload" href="/css/main.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="/css/main.css"></noscript>

For JavaScript, defer everything that isn't critical. Most analytics, chat widgets, and social embeds don't need to block render. Use defer for scripts that can wait until HTML parsing completes:

<script src="/js/analytics.js" defer></script>

Third-party scripts are the worst offenders. Google Tag Manager, Facebook Pixel, and ad networks inject render-blocking code you don't control. Load them with Partytown or a similar web worker solution that runs scripts off the main thread. That keeps INP scores clean even when tags fire.

3. Configure server-side compression and caching headers

Uncompressed responses waste bandwidth and slow time-to-first-byte. Gzip is standard but Brotli compresses text assets 15-20% smaller. Enable it in your web server config.

For Apache on cPanel or a VPS, add this to your .htaccess or virtual host config:

<IfModule mod_brotli.c>
  AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>

For nginx:

brotli on;
brotli_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml;

Next, set aggressive cache headers for static assets. CSS, JS, and images rarely change; instruct browsers to cache them for a year:

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType text/css "access plus 1 year"
  ExpiresByType application/javascript "access plus 1 year"
</IfModule>

Bust the cache by appending a version query string (style.css?v=2) or fingerprinting the filename when you deploy changes.

4. Lazy-load images and iframes below the fold

Don't load assets the user hasn't scrolled to yet. Lazy-loading defers image and iframe requests until the viewport is close, which cuts initial page weight and improves LCP for the hero section.

Native browser lazy-loading is simple and effective:

<img src="below-fold.webp" alt="Gallery image" loading="lazy" width="800" height="600">

Never lazy-load your LCP image—the largest visible element in the first viewport. That delays the load and tanks your LCP score. Check your PageSpeed Insights report to identify which image is LCP, then mark it with fetchpriority="high" and loading="eager":

<img src="hero.webp" alt="Hero" fetchpriority="high" loading="eager" width="1200" height="630">

For iframes (YouTube embeds, maps, third-party widgets), lazy-load aggressively. Replace the iframe with a static thumbnail and inject the iframe on click using a façade pattern. Paul Irish's lite-youtube-embed web component is a clean implementation.

5. Reduce and defer third-party requests

Every external domain adds DNS lookup, TLS handshake, and round-trip latency. Tag managers, fonts, CDNs, and marketing pixels pile up fast. I've seen WordPress sites making 40+ third-party requests on first load.

Audit what's loading with your browser's network inspector. Kill anything that isn't directly serving users—old tracking pixels, unused A/B test scripts, abandoned chat widgets. Each request you remove is 50-200 ms saved.

For Google Fonts, self-host the WOFF2 files instead of loading from fonts.googleapis.com. Download the font files and update your CSS:

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-var.woff2') format('woff2');
  font-display: swap;
}

font-display: swap prevents invisible text during font load. Text renders in a fallback font immediately, then swaps when the web font arrives. That keeps INP clean and avoids CLS if you size-match your fallback with size-adjust.

6. Fix layout shifts caused by dynamic content

CLS (Cumulative Layout Shift) measures visual instability—elements jumping around as the page loads. Common causes: images without dimensions, ads inserting without reserved space, and web fonts swapping in late.

Reserve space for every dynamic element. If you inject an ad slot, wrap it in a container with a fixed min-height:

.ad-slot {
  min-height: 250px;
  background: #f0f0f0;
}

For web fonts, use size-adjust in your @font-face rule to scale the fallback font to match your web font's metrics. This prevents the layout reflow when the web font loads:

@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

Calculate the overrides using a tool like Capsize or measure the fonts yourself. The goal is to make the fallback font occupy the same layout space.

Banners and cookie consent popups also trigger CLS if they push content down. Load them at the top of the DOM or position them with position: fixed so they don't affect layout.

7. Use a CDN with edge caching for static assets

CDNs reduce TTFB and improve LCP by serving assets from a location near the user. Cloudflare, BunnyCDN, and KeyCDN all work. Configure your CDN to cache static files aggressively and set a long TTL.

For WordPress on shared hosting, install a plugin like WP Rocket or W3 Total Cache that pushes static assets to your CDN automatically. Point your CDN's origin to your site and update your asset URLs.

If you manage a VPS, configure your web server to set a Cache-Control header and verify the CDN respects it:

location ~* \.(jpg|jpeg|png|webp|avif|css|js|woff2)$ {
  expires 1y;
  add_header Cache-Control "public, immutable";
}

Test with curl -I and check the response headers:

curl -I https://yoursite.com/image.webp

You should see cf-cache-status: HIT (Cloudflare) or equivalent from your CDN. If you see MISS or DYNAMIC, your cache rules need adjustment.

What about server response time?

Server response time feeds into TTFB and indirectly affects LCP. If your HTML takes 1.5 seconds to return, everything downstream suffers.

Upgrade to PHP 8.3 if you're still on 7.4 or earlier. The performance jump is substantial. Enable OPcache in your php.ini:

opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000

For database-heavy WordPress installs, add Redis or Memcached as an object cache. Install the Redis Object Cache plugin and verify it's connected:

redis-cli ping

You should see PONG. Once connected, your database query count drops and page generation time falls.

If you're on cPanel shared hosting with limited control, work with your host to confirm PHP version and whether object caching is available. Some shared plans include Redis access; others require a VPS upgrade.

How do I measure Core Web Vitals after making changes?

Use Google PageSpeed Insights for lab data and real-user monitoring. Run a test, note your LCP, INP, and CLS scores, apply fixes, and re-test after a day or two once real users hit the updated pages.

For ongoing monitoring, Search Console's Core Web Vitals report shows field data from actual Chrome users. That's what Google uses for ranking.

Which fix has the biggest impact?

Image optimization. Most sites serve bloated images and fixing that alone can cut 2-3 seconds off LCP. Start there.

Does hosting server location affect Core Web Vitals?

Yes, but CDN edge caching largely neutralizes it. If most users are in Europe and your origin is in the US, serve static assets from a European edge. TTFB improves and LCP follows.

Can I ignore INP if my LCP and CLS are good?

No. INP replaced FID in 2024 and measures responsiveness to user input. Heavy JavaScript or long tasks block the main thread and inflate INP. Users feel the lag even if your page loads fast.

Start with images and scripts

Core Web Vitals optimization in 2026 isn't about exotic techniques. Compress images properly, defer non-critical scripts, and fix layout shifts. Those three moves handle 80% of performance problems I see in support tickets.

Run PageSpeed Insights now, identify your LCP element, and optimize the assets around it. Check which scripts block render and defer them. Reserve space for ads and dynamic content. Make those changes and your scores will move within a week.