Skip to main content
KadiCache
Lighthouse: font-display · Media & Fonts10 min read1,036 wordsVerified 2026-11-23

How to Fix “Ensure text remains visible during webfont load” in WordPress

Browsers hide headings and body text for up to 3 full seconds (Flash of Invisible Text) whenever @font-face rules omit font-display: swap or optional. Make text paint immediately—with zero layout shift when custom fonts arrive.

Ensure text remains visible during webfont load (font-display) WordPress optimization diagram
0.000 Layout Shift6 Sections✓ Verified
Lighthouse Audit ID
font-display
Metrics Affected
FCP · CLS
KadiCache Solution Tier
Free Core + Cloud Pro
3-Step Quick Action Plan (Schema HowTo)
STEP 01
Self-Host Google Fonts & Enforce font-display: swap Automatically

Open WP Admin -> KadiCache -> Fonts and enable Self-host Google Fonts and Force font-display: swap across theme, page-builder, and plugin @font-face rules.

STEP 02
Preload 1–2 Critical Above-the-Fold Local WOFF2 Files

In KadiCache -> Fonts -> Preload Critical WOFF2, add your primary heading and body local .woff2 URLs (up to 5 max) so browsers fetch them alongside HTML.

STEP 03
Enable Cloud Pro WOFF2 Subsetting & Metric-Matched Fallbacks

Toggle ON Subset fonts, Fallback font metrics (size-adjust / ascent-override), and Remove unused fonts so text swaps cleanly with 0.000 CLS.

WP Admin -> KadiCache -> Fonts
MODULE Media & Fonts · 2X RETINA
Self-host Google Fonts locally, subset WOFF2 glyph ranges in the cloud, and synthesize metric-matched fallback @font-face rules.2880×1840 WebP
⚡ Executive Summary · 30-Second Spec100% Code-Verified
WP Admin Path
WP Admin -> KadiCache -> Fonts
Measured Impact
Eliminates up to 3,000 ms Invisible Text (FOIT) · 0.000 Font CLS
DevTools Proof Marker
Lighthouse ID: font-display | font-display: swap + size-adjust
  • Lighthouse flags font-display whenever any @font-face rule loaded on the page lacks font-display: swap, optional, or fallback—causing Chromium to hold text completely invisible (FOIT) for up to 3,000 ms on slow 4G!
  • Common WordPress offenders: older Google Fonts fonts.googleapis.com/css?family=... URLs without &display=swap, custom .woff2 fonts uploaded in Elementor / Customizer, and icon fonts (Font Awesome, eicons, Astra.woff).
  • Important Tradeoff: Adding font-display: swap alone fixes invisible text (FCP)—but when a wide Google or Arabic font swaps over Arial/Tahoma 600 ms later, line breaks jump and hurt CLS!
  • Complete KadiCache Fix: Self-Host Google Fonts + font-display: swap + WOFF2 Preload (Free Core) paired with WOFF2 Subsetting + Metric-Matched Fallbacks (Cloud Pro).
Table of Contents (6 sections)

Why Browsers Hide Your Text (FOIT vs FOUT Explained)#

When Chrome matches an <h1> or <p> element styled with font-family: "Inter", sans-serif and sees a @font-face rule whose .woff2 file has not finished downloading yet, the font-display descriptor decides whether visitors read your content immediately or stare at blank phantom boxes:

font-display ValueBlock Period (Invisible Text)Swap PeriodLighthouse font-display Audit Result
auto / omitted (Default!)Up to 3,000 ms invisible!InfiniteFAILS (Ensure text remains visible)
blockUp to 3,000 ms invisible!InfiniteFAILS (Acceptable only for pure icon glyph ligatures)
swap~0 ms (paints fallback immediately)Infinite (swaps when .woff2 arrives)PASSES (Best when paired with metric-matched fallbacks!)
fallback~100 ms~3,000 msPASSES
optional~100 ms0 ms (uses custom font only if cached/fast)PASSES (Zero shift, but first visit may show system font)

On a mobile 4G connection (150 ms RTT), an unoptimized Google Font requires: (1) HTML download → (2) external fonts.googleapis.com CSS fetch → (3) external fonts.gstatic.com DNS + TLS handshake → (4) .woff2 download. That chain routinely takes 850 ms to 1,900 ms—meaning without font-display: swap, your First Contentful Paint (FCP) and text LCP sit frozen behind blank white space!

FIG 01Self-hosting Google Fonts locally, enforcing font-display: swap, and enabling Cloud WOFF2 subsetting & metric-matched fallbacks inside WP Admin -> KadiCache -> FontsZoom 2x

Manual Developer CSS Fix (And the crossorigin Double-Download Bug)#

When self-hosting custom brand fonts manually in a WordPress theme stylesheet, always declare font-display: swap inside @font-face and include crossorigin on any <link rel="preload" as="font"> tag—even when the .woff2 file lives on your exact same domain!

HTMLCorrect Manual WOFF2 Preload + Metric-Adjusted Fallback @font-face
<!-- CRITICAL: W3C Fetch spec requires crossorigin on ALL font preloads (even same-origin!),
     otherwise Chrome downloads the .woff2 file TWICE! -->
<link rel="preload"
      href="/wp-content/themes/brand/fonts/inter-latin-700.woff2"
      as="font"
      type="font/woff2"
      crossorigin>

<style>
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/wp-content/themes/brand/fonts/inter-latin-700.woff2") format("woff2");
}

/* Calibrated system fallback so swapping from Arial -> Inter causes 0.000 CLS */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.4%;
  ascent-override: 90.2%;
  descent-override: 22.5%;
  line-gap-override: 0%;
}
</style>

How KadiCache Solves Webfont Visibility & Zero-CLS Swaps Automatically#

FIG 02Preloading up to 5 critical above-the-fold WOFF2 files safely via ResourceHints.phpZoom 2x

Layer 1 — Free Core Local Google Fonts, swap Enforcement & Smart Preloads#

  • Self-Host Google Fonts (FontOptimizer.php & FontAssetDownloader.php): Downloads Google Fonts .woff2 files into wp-content/kadicache-assets/fonts/, rewrites fonts.googleapis.com / fonts.gstatic.com stylesheets to your own origin, and eliminates external DNS/TLS chains (Local Fonts Guide).
  • Automatic font-display: swap (FontCss.php): Injects or upgrades font-display: swap across Google Fonts, theme @font-face blocks, and Elementor custom fonts—clearing Lighthouse’s font-display warning immediately.
  • Validated WOFF2 Preload (ResourceHints.php): Lets you preload up to 5 critical local .woff2 files right after <meta charset> with automatic type="font/woff2" crossorigin="anonymous" deduplication and Content-Security-Policy (CspPolicy.php) validation!

Layer 2 — Cloud Pro Font Subsetting, Fallback Metrics & Unused Font Removal#

  • WOFF2 Glyph Subsetting: Shrinks bloated 120–280 KB Latin and Arabic (Cairo, Tajawal, Almarai) font files by 60%–85% down to active Unicode ranges (Cloud Font Optimization).
  • Automatic Fallback Font Metrics: Reads exact OpenType head / hhea / OS/2 metrics from each webfont and synthesizes size-adjust, ascent-override, and descent-override fallback rules so text never jumps when .woff2 arrives!
  • Remove Unused Fonts: Drops @font-face weights (100 Thin, 300 Light Italic, 900 Black) that no active CSS rule on the page actually uses.

Troubleshooting Specific WordPress Font Sources Flagged by Lighthouse#

Expand Ensure text remains visible during webfont load in PageSpeed Insights and match the flagged .woff2 / .ttf URL against this WordPress diagnostic table:

Flagged Font URL PatternWhere It Came From in WordPressImmediate Fix
fonts.gstatic.com/s/.../*.woff2Theme, Elementor, or Slider Revolution loading Google Fonts without &display=swapEnable Self-host Google Fonts + Force font-display: swap in KadiCache -> Fonts
/wp-content/uploads/elementor/custom-fonts/*.woff2Custom brand font uploaded in Elementor -> Custom Fonts with font-display: autoKadiCache -> Fonts automatically injects font-display: swap (and you can set swap in Elementor -> Settings -> Advanced)
/plugins/elementor/assets/lib/eicons/fonts/eicons.woff2Elementor’s legacy icon font (~92 KB)Enable Elementor’s Inline Font Icons feature (Elementor -> Settings -> Features) to eliminate eicons.woff2 completely!
/plugins/.../fontawesome/webfonts/fa-solid-900.woff2Theme or plugin loading full Font Awesome icon fontEnable Force font-display: swap + Cloud Subset Fonts (or switch theme icons to inline SVGs)
cdn.your-site.com/.../*.woff2 blocked by CORSPull-CDN CNAME missing Access-Control-Allow-Origin headerOpen KadiCache -> CDN -> Asset Rules & CORS Modal (CDN & CORS Guide) for 1-click Nginx/Apache rules

Eliminating external fonts.googleapis.com chains and unused font weights routinely cuts 180 KB–420 KB of early critical-path bytes while making headings paint 900+ ms sooner on mobile 4G.

“Ensure text remains visible during webfont load” — Frequently Asked Questions

Does self-hosting Google Fonts also help with European GDPR / DSGVO privacy compliance?
Yes! German and EU courts (such as LG München) fined websites for leaking visitor IP addresses to Google servers via external fonts.googleapis.com requests without prior consent. KadiCache FontOptimizer.php serves all Google Fonts directly from your own WordPress domain with zero external Google calls!
Why does Lighthouse still flag a third-party iframe’s font (like YouTube Roboto or reCAPTCHA) even after fixing my site fonts?
External YouTube embeds and Google reCAPTCHA iframes load Roboto from fonts.gstatic.com WITHOUT font-display: swap inside Google’s own iframe! Enabling KadiCache’s YouTube Preview Facade (Lazyload) and Delay JS removes those third-party iframes from initial page load—clearing their font warnings too!
Should I upload .ttf, .otf, .eot, or .woff2 when adding custom brand fonts to WordPress?
Always upload WOFF2 (.woff2) only! WOFF2 uses Brotli entropy coding supported by 99%+ of all modern mobile and desktop browsers and is 30%–55% smaller than legacy TTF or WOFF1 files.
What if I serve local WOFF2 fonts via a Pull-CDN CNAME (cdn.example.com) and icons stop rendering?
Browsers enforce strict Cross-Origin Resource Sharing (CORS) on @font-face files! Open WP Admin -> KadiCache -> CDN -> Asset Rules & CORS Modal to copy KadiCache’s ready-made 1-click Nginx or Apache Access-Control-Allow-Origin snippet.
Does KadiCache Cloud Font Subsetting support right-to-left (RTL) Arabic fonts like Cairo and Tajawal?
Yes! Arabic glyph shaping, ligatures, and active Unicode ranges are preserved cleanly while stripping unused glyphs, cutting heavy 180 KB Arabic font payloads down dramatically.
Verified WordPress Fix · font-display
Clear “Ensure text remains visible during webfont load” without breaking Elementor or WooCommerce.
E-E-A-T Source Verified

Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.

apps/wordpress-plugin/src/Optimization/FontOptimizer.phpapps/wordpress-plugin/src/Optimization/FontCss.phpapps/wordpress-plugin/src/Optimization/Fonts/FontAssetDownloader.phpapps/wordpress-plugin/src/Optimization/ResourceHints.php
Connected Topical Cluster · Continue Deepening Your Setup