Core Web Vitals: Why Custom PHP Scores 100 – And WordPress Rarely Breaks 60
Google’s Core Web Vitals are a confirmed ranking factor. But here’s what most developers won’t tell you: the platform you choose determines 80% of your baseline score. Custom PHP can hit 100 with minimal effort. WordPress – even with caching plugins – usually lands in the 40–60 range. I’ve built and optimized both. Let me show you exactly why, with real numbers, code, and client results.
The Business Case for Passing Core Web Vitals
Before diving into code, understand the impact. Google’s data shows:
- Sites that pass Core Web Vitals see 24% fewer user abandonment.
- A 0.5s improvement in LCP can increase conversions by 12–15% (Google case study).
- Page experience is now a tiebreaker when two pages have similar relevance.
Your platform choice isn't just about developer convenience – it’s a direct driver of revenue and rankings.
The Raw Numbers: Custom PHP vs WordPress (Same Server)
I ran a controlled test on identical hosting (Hostinger VPS, 2 vCPU, 2GB RAM, NVMe storage). Two websites:
- Site A: Custom PHP/HTML, no framework, minimal CSS/JS, hand‑optimized.
- Site B: Fresh WordPress 6.7 + Astra theme + 5 essential plugins (Yoast SEO, LiteSpeed Cache, Contact Form 7, Social Snap, Smush).
| Metric | Custom PHP | WordPress | Improvement |
|---|---|---|---|
| LCP (Largest Contentful Paint) | 0.8s | 3.9s | 79% faster |
| INP (Interaction to Next Paint) | 45ms | 312ms | 85% faster |
| CLS (Cumulative Layout Shift) | 0.01 | 0.23 | 96% lower |
| TTFB (Time To First Byte) | 180ms | 670ms | 73% faster |
| Total JavaScript Size | 23KB | 847KB | 97% smaller |
The 847KB of JavaScript is the killer. WordPress loads jQuery, the block editor, plugin scripts, and theme assets – even if you’re not using them. Google’s Lighthouse measures all of it, and every kilobyte adds to LCP and INP.
Core Web Vitals Explained (2026 Thresholds)
Google has confirmed that page experience is a ranking signal on both mobile and desktop. In 2026, the thresholds are:
- LCP (Largest Contentful Paint) – measures loading speed. Good: under 2.5s.
- INP (Interaction to Next Paint) – measures responsiveness. Good: under 200ms. (Replaced FID in 2024.)
- CLS (Cumulative Layout Shift) – measures visual stability. Good: under 0.1.
- TTFB (Time To First Byte) – server response. Good: under 600ms (unofficial, but Google uses it).
A site that fails these metrics gets pushed down below faster competitors – even if it has more backlinks.
How Custom PHP Achieves a Perfect 100 (Real Code + Edge Techniques)
Here’s exactly what I do on every custom build to guarantee a 100 Lighthouse score.
1. Preload Critical Assets
Tell the browser what’s most important before it even parses HTML.
<link rel="preload" href="hero.webp" as="image" fetchpriority="high">
<link rel="preload" href="critical.css" as="style">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
2. Inline Above‑the‑Fold CSS (Cut FCP in Half)
Extract only the styles needed for the visible area. Use Chrome Coverage tab to find unused CSS.
<style>
/* Only styles for visible content – typically 3-8KB */
body { font-family: 'Inter', sans-serif; background: #0a0a0a; margin:0; }
.hero { min-height: 100vh; display: flex; align-items: center; }
.btn { background: #3b82f6; padding: 12px 28px; border-radius: 40px; }
</style>
<link rel="preload" href="full-styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="full-styles.css"></noscript>
3. Serve Responsive Images with srcset & WebP
Most sites serve desktop-sized images to mobile – a huge LCP penalty. Use `srcset` to serve appropriately sized images.
<img src="hero-800.webp"
srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
sizes="(max-width: 600px) 400px, (max-width: 1000px) 800px, 1200px"
width="1200" height="630"
loading="eager"
alt="Hero image">
4. Optimize Server Response (TTFB)
I use PHP‑FPM with OPcache enabled, GZIP compression, and database indexing. No WordPress `wp_query` overhead means queries return in 5–15ms, not 150ms. Additional tweaks:
- Enable Keep‑Alive and HTTP/2.
- Use a CDN (Cloudflare or Bunny.net) to cache static assets.
- Move database to a separate server or use Redis for object caching if needed.
5. Eliminate Layout Shifts (CLS = 0.01)
Every image, video, and ad slot gets explicit `width` and `height` attributes. Reserve space for fonts with `font-display: swap`.
/* In CSS */
@font-face {
font-family: 'Inter';
font-display: swap;
/* ... */
}
6. Defer Non‑Critical JavaScript
Use `defer` or `async` on all external scripts, and move analytics to load after user interaction.
<script defer src="analytics.js"></script>
<script>
window.addEventListener('load', function() {
// Load non‑critical JS here
});
</script>
7. Use `loading="lazy"` for Below‑Fold Images
Images not visible initially should be lazy‑loaded. This saves bandwidth and speeds up LCP.
Why WordPress Can’t Easily Match These Numbers
I’m not saying WordPress is terrible – it’s great for blogging and non‑technical users. But for performance:
- Every plugin adds its own CSS/JS, often without `async` or `defer`. Even “optimized” plugins add overhead.
- The block editor loads 500KB+ of JavaScript even if you’re just using a simple page. That’s half a megabyte of unused code.
- Caching plugins help, but they can’t remove the underlying bloat – they only cache the already‑bloated output.
- Third‑party themes bundle entire frameworks (Bootstrap, Tailwind) – 90% unused CSS that still blocks rendering.
Even if you temporarily get a 90 on Lighthouse, a plugin update or a new theme can tank it to 45 overnight. With custom PHP, your performance is deterministic – it doesn’t change unless you change it.
Two Real Client Transformations
Case Study 1: WooCommerce Jewelry Store → Custom PHP
A jewelry store had a WooCommerce site scoring 43 on Lighthouse (mobile). They had 12 active plugins, a bloated theme, and load times of 4.2s. After migrating to a custom PHP store with Stripe Checkout:
- Lighthouse score: 43 → 98.
- Mobile load time: 4.2s → 0.9s.
- Conversion rate: 1.8% → 3.4% (+89%).
- Average order value increased by 22% (faster checkout encouraged upsells).
Case Study 2: Real Estate Site with 500+ Pages
A real estate agency had a WordPress site with page load times of 3.5 seconds and a CLS of 0.28 (poor). We rebuilt the front‑end as a custom PHP site using a lightweight template, inlined critical CSS, and preloaded hero images.
- LCP: 3.1s → 0.9s.
- CLS: 0.28 → 0.02.
- Bounce rate dropped from 58% to 37%.
- Contact form submissions increased by 41% within 60 days.
The Hidden Cost of Page Builders: Wix, Squarespace, Shopify
It’s not just WordPress. All drag‑and‑drop platforms suffer from poor defaults:
- Wix/Squarespace: Inline styles everywhere, huge DOM size, and no control over critical CSS. Average Lighthouse mobile score: 30–50.
- Shopify: Better than Wix, but themes load heavy JavaScript and external fonts. Average score: 60–75.
- Webflow: Can be optimized, but requires expert knowledge and still outputs bloated code compared to hand‑coded PHP.
Only custom PHP gives you full control over every byte that reaches the browser.
How to Start (Even If You’re Not a Developer)
You don’t need to write everything from scratch. I build each website manually, so you get a 100% tailored codebase. The result: a Lighthouse score you can screenshot and use as a trust signal. You can also start with a static site generator (Hugo, Eleventy) and later add PHP for dynamic features.
Action Plan: Get Your Site to 100 Today
- Test your current site on PageSpeed Insights (mobile). Note your LCP, INP, CLS.
- Fix low‑hanging fruit: compress images, enable caching, remove unused plugins.
- If you’re below 70, consider a platform migration. The ROI on a custom PHP site often pays for itself in 6–12 months through higher conversions and lower hosting costs.
- Or hire me. I’ll build you a custom PHP site that scores 100 – guaranteed.
Final Summary: Platform Choice Is 80% of the Battle
You can optimize any site, but starting with custom PHP gives you a massive head start. WordPress requires constant fighting against its own architecture. Wix and Squarespace lock you into slow templates. Custom PHP puts you in full control. The numbers speak for themselves.
If you want a website that natively scores 96–100 on Lighthouse and outranks page builders, let’s talk.
All test data collected on Hostinger VPS (2 vCPU, 2GB RAM) using Lighthouse 12.0 (mobile simulation). Your results may vary based on content and hosting.