Home / Guides / WordPress handbook / Chapter 14

WordPress handbook · Chapter 14 · Infrastructure

Performance Optimisation and Core Web Vitals

Speed has two halves. Server-side speed is how fast the HTML arrives; front-end speed is how fast the browser can turn that HTML into a usable page. Most WordPress performance advice mixes the two up, so people install a fifth optimisation plugin to fix a slow database. This chapter separates them, explains how each is measured, and gives an order of work that fixes the biggest problem first.

Updated · 8 min read · Level: Advanced

On this page
  1. Measure before you optimise
  2. Core Web Vitals explained
  3. Server-side performance: making WordPress generate pages faster
  4. Front-end performance: assets, images, fonts and scripts
  5. Page builders, themes and DOM size
  6. WooCommerce performance specifics
  7. Performance troubleshooting by symptom
  8. Performance checklist

Measure before you optimise

There are two kinds of measurement, and they answer different questions:

  • Lab data (PageSpeed Insights' Lighthouse section, Lighthouse in Chrome DevTools, WebPageTest) loads a page once under fixed, simulated conditions. It is repeatable and diagnostic: it tells you why a page is slow.
  • Field data (the Chrome User Experience Report shown at the top of PageSpeed Insights, Search Console's Core Web Vitals report, real-user monitoring) records what real visitors experienced over the previous 28 days. It is what Google uses for its page-experience signals, and it is what your customers actually feel. It changes slowly after fixes.

A lab score of 100 with poor field data means real visitors have slower devices, networks or pages than the test. A poor lab score with good field data is usually not urgent. Always test the templates that matter (home, product, article, checkout), on mobile settings, logged out, and with a warm cache as well as a cold one.

Server timing first

for i in 1 2 3 4 5; do curl -s -o /dev/null -w "TTFB %{time_starttransfer}s  total %{time_total}s  code %{http_code}\n" https://example.com/; done
# Bypass page cache to see raw WordPress generation time (adds a unique query string):
curl -s -o /dev/null -w "uncached TTFB %{time_starttransfer}s\n" "https://example.com/?nocache=$(date +%s)"

As a rough guide, cached HTML should arrive in well under 200 ms from a nearby location, and uncached WordPress pages in under about 600–800 ms. If uncached generation takes several seconds, no front-end plugin will fix it; go to server-side performance. Note that some caches ignore query strings, so the bypass trick may not work everywhere; logging in also bypasses most page caches.

Core Web Vitals explained

MetricWhat it measures"Good" threshold (75th percentile)Common WordPress causes of poor scores
LCP: Largest Contentful PaintWhen the largest visible element (usually the hero image or headline) finishes rendering≤ 2.5 sSlow server response; hero image lazy-loaded or huge; render-blocking CSS; web fonts delaying text; sliders loading many images
INP: Interaction to Next PaintHow quickly the page responds visually to clicks, taps and key presses, across the visit≤ 200 msHeavy JavaScript from builders, sliders, chat widgets, tag managers and ad scripts; long tasks on the main thread; large DOM
CLS: Cumulative Layout ShiftHow much visible content jumps around unexpectedly≤ 0.1Images and embeds without width/height; late-loading banners, cookie bars and ads pushing content; web fonts swapping with different metrics

INP replaced First Input Delay as a Core Web Vital in March 2024. Supporting metrics such as TTFB (time to first byte) and FCP (first contentful paint) are diagnostic, not ranking metrics, but a slow TTFB drags LCP down with it.

Server-side performance: making WordPress generate pages faster

  1. Modern PHP with OPcache. Each major PHP release has brought measurable speed improvements. Confirm OPcache is enabled and not full (Chapter 06).
  2. Page caching for anonymous traffic. One layer, correctly purged, with transactional pages excluded. This is the single biggest win for most sites.
  3. Persistent object cache (Redis/Memcached) for logged-in, WooCommerce, membership and LMS traffic, which page caching cannot help.
  4. Find slow components with Query Monitor on staging: slowest queries, duplicate queries, HTTP API calls made during page generation, and the hooks consuming the most time. A single plugin making a 2-second external call on every page is common.
  5. Autoloaded options: check their total size (Chapter 08). Megabytes of autoloaded data slow every uncached request.
  6. Database health: oversized log/session tables, missing indexes on custom tables, Action Scheduler backlogs.
  7. Move work out of page loads: imports, feed generation, emails and syncs into background jobs; WP-Cron onto a system cron.
  8. Capacity: only after the above, check PHP worker limits and CPU/RAM against traffic (Chapter 06).
Why "more plugins" is not automatically "slower"

The number of plugins matters less than what they do on each request. Ten small, well-written plugins can cost less than one plugin that queries every order on every page. Measure per-plugin cost instead of counting plugins.

Front-end performance: assets, images, fonts and scripts

CSS

  • Render-blocking CSS delays first paint. Critical CSS (inlining the styles needed above the fold and loading the rest later) helps LCP, but must be regenerated when designs change.
  • Unused CSS removal shrinks stylesheets but can drop styles used only after interaction (menus, modals, tabs, dynamically inserted classes). Always keep a safelist.
  • Combining stylesheets mattered under HTTP/1.1; with HTTP/2 and HTTP/3 it rarely helps and often breaks cascade order. Prefer minify without combine.

JavaScript

  • defer lets scripts download in parallel and run after parsing, in order. It is safe for most scripts and improves LCP.
  • async runs scripts as soon as they arrive, out of order. It is only for independent scripts such as analytics.
  • Delay until interaction holds scripts until the user scrolls or clicks. It produces excellent lab scores but often breaks real features (Chapter 03), and can hurt INP because all the delayed scripts run at the first interaction. Use it selectively for third-party widgets, never for consent, payment, CAPTCHA or navigation scripts.
  • Third-party scripts (chat widgets, heatmaps, tag managers carrying many tags, social embeds, video players) are usually the largest INP cost. Audit them quarterly and remove what nobody uses.

Images

  • Serve appropriately sized images. WordPress generates sub-sizes and srcset automatically; make sure themes use them instead of full-size originals.
  • Use modern formats (WebP widely, AVIF where supported) through one system (Chapter 13 lists the overlaps).
  • Never lazy-load the LCP image. WordPress core avoids lazy-loading the first content images and adds fetchpriority="high" to the likely LCP image; plugins that force lazy-loading on everything undo this.
  • Always include width and height (or CSS aspect-ratio) to prevent layout shift.
  • Replace sliders on the home page with a single static hero; sliders cost LCP, INP and usually conversions too.

Fonts

  • Host fonts locally (avoids extra DNS/TLS to font services and helps privacy compliance), limit families and weights, use WOFF2.
  • Preload only the one or two fonts used above the fold. Use font-display: swap (or optional) with fallback fonts sized to match, to reduce CLS.
  • Icon fonts (whole Font Awesome sets for three icons) are a common waste; use inline SVG.

Video and embeds

Replace YouTube/Vimeo iframes with a lightweight placeholder that loads the player on click ("lite embeds"). Maps and social embeds can be handled the same way, which also simplifies cookie consent.

Page builders, themes and DOM size

Builders wrap content in many nested containers, and every element costs style calculation and layout time. Very large DOMs (thousands of nodes) hurt INP and memory on phones. Practical measures:

  • Use the builder's performance settings: optimised DOM output, flexbox containers instead of nested sections, loading only widget assets used on the page, and disabling unused widgets globally.
  • Remove add-on packs whose widgets are barely used.
  • Keep mega-menus and footers lean, since they appear on every page.
  • For new builds, lighter block themes with a small block library often reach good Core Web Vitals with far less tuning.

WooCommerce performance specifics

  • Enable High-Performance Order Storage (HPOS) when all extensions are compatible; order queries become much faster on large stores.
  • Keep cart, checkout and account uncached, but make sure product, category and content pages are cached for anonymous visitors.
  • Limit cart fragments to pages with a mini-cart (Chapter 03).
  • Product filters with many attribute combinations are database-heavy; use plugins built on lookup tables and limit crawler access.
  • Watch Action Scheduler: failing jobs pile up and slow admin screens.
  • Use a persistent object cache: logged-in customers and carts are dynamic by nature.

Performance troubleshooting by symptom

SymptomMost likely causeCheckFix
Slow for everyone, every pagePage cache not working, or slow serverCache headers; uncached TTFBFix the cache layer; then server-side profiling
Fast logged out, slow logged in / wp-adminSlow plugins, autoloaded options, no object cache, HeartbeatQuery Monitor in admin; autoload sizeObject cache; fix slow plugin; reduce Heartbeat frequency
Slow at specific timesBackups, scans, cron jobs, crawler burstsCorrelate with schedules and access logsReschedule jobs; rate-limit crawlers
Good lab score, poor field LCPReal users on slow devices/networks; uncached first visits; geographic distanceField data by device; CDN coverageCDN for HTML where safe; lighter hero; less JS
Poor INPHeavy third-party or builder JavaScriptPerformance panel in DevTools (long tasks)Remove/defer third parties; simplify interactive widgets
Poor CLSImages without dimensions, late banners, font swapsLayout shift regions in DevToolsReserve space; dimensions; font fallbacks
Slow only on product filters or searchExpensive queries, unlimited variantsSlow query log; access logsIndexed filtering; search plugin; crawl limits
Slow after an updateNew plugin behaviour or regressionCompare with staging on old versionRoll back; report to vendor

Performance checklist

  • Field data (Search Console / PageSpeed Insights) reviewed for mobile and desktop.
  • Supported PHP version with OPcache enabled and not full.
  • Exactly one page-cache layer, verified by response headers, with transactional pages excluded.
  • Persistent object cache for dynamic or logged-in traffic.
  • Autoloaded options under control; log and session tables pruned.
  • No slow external HTTP calls during page generation (Query Monitor).
  • WP-Cron moved to a system cron for busy sites.
  • One CSS/JS optimiser; exclusions documented.
  • LCP image not lazy-loaded, correctly sized, in a modern format.
  • All images and embeds have dimensions; banners reserve space.
  • Fonts self-hosted, limited, preloaded only above the fold.
  • Third-party scripts audited; unused ones removed.
  • CDN in place for static assets (and HTML where safe).

Rather have someone else keep WordPress healthy?

Our managed hosting and care plans cover updates, backups, security monitoring and fixes like the ones in this handbook, so you can get on with running the business.

See Hosting & Care