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.

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.
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.
Toggle ON Subset fonts, Fallback font metrics (size-adjust / ascent-override), and Remove unused fonts so text swaps cleanly with 0.000 CLS.
- Lighthouse flags
font-displaywhenever any@font-facerule loaded on the page lacksfont-display: swap,optional, orfallback—causing Chromium to hold text completely invisible (FOIT) for up to3,000 mson slow 4G! - Common WordPress offenders: older Google Fonts
fonts.googleapis.com/css?family=...URLs without&display=swap, custom.woff2fonts uploaded in Elementor / Customizer, and icon fonts (Font Awesome,eicons,Astra.woff). - Important Tradeoff: Adding
font-display: swapalone fixes invisible text (FCP)—but when a wide Google or Arabic font swaps overArial/Tahoma600 ms later, line breaks jump and hurtCLS! - 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)
- Manual Developer CSS Fix (And the crossorigin Double-Download Bug)
- How KadiCache Solves Webfont Visibility & Zero-CLS Swaps Automatically
- Layer 1 — Free Core Local Google Fonts, swap Enforcement & Smart Preloads
- Layer 2 — Cloud Pro Font Subsetting, Fallback Metrics & Unused Font Removal
- Troubleshooting Specific WordPress Font Sources Flagged by Lighthouse
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 Value | Block Period (Invisible Text) | Swap Period | Lighthouse font-display Audit Result |
|---|---|---|---|
auto / omitted (Default!) | Up to 3,000 ms invisible! | Infinite | FAILS (Ensure text remains visible) |
block | Up to 3,000 ms invisible! | Infinite | FAILS (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 ms | PASSES |
optional | ~100 ms | 0 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!
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!
<!-- 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#
Layer 1 — Free Core Local Google Fonts, swap Enforcement & Smart Preloads#
- Self-Host Google Fonts (
FontOptimizer.php&FontAssetDownloader.php): Downloads Google Fonts.woff2files intowp-content/kadicache-assets/fonts/, rewritesfonts.googleapis.com/fonts.gstatic.comstylesheets to your own origin, and eliminates external DNS/TLS chains (Local Fonts Guide). - Automatic
font-display: swap(FontCss.php): Injects or upgradesfont-display: swapacross Google Fonts, theme@font-faceblocks, and Elementor custom fonts—clearing Lighthouse’sfont-displaywarning immediately. - Validated WOFF2 Preload (
ResourceHints.php): Lets you preload up to 5 critical local.woff2files right after<meta charset>with automatictype="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 KBLatin and Arabic (Cairo,Tajawal,Almarai) font files by60%–85%down to active Unicode ranges (Cloud Font Optimization). - Automatic Fallback Font Metrics: Reads exact OpenType
head/hhea/OS/2metrics from each webfont and synthesizessize-adjust,ascent-override, anddescent-overridefallback rules so text never jumps when.woff2arrives! - Remove Unused Fonts: Drops
@font-faceweights (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 Pattern | Where It Came From in WordPress | Immediate Fix |
|---|---|---|
fonts.gstatic.com/s/.../*.woff2 | Theme, Elementor, or Slider Revolution loading Google Fonts without &display=swap | Enable Self-host Google Fonts + Force font-display: swap in KadiCache -> Fonts |
/wp-content/uploads/elementor/custom-fonts/*.woff2 | Custom brand font uploaded in Elementor -> Custom Fonts with font-display: auto | KadiCache -> Fonts automatically injects font-display: swap (and you can set swap in Elementor -> Settings -> Advanced) |
/plugins/elementor/assets/lib/eicons/fonts/eicons.woff2 | Elementor’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.woff2 | Theme or plugin loading full Font Awesome icon font | Enable Force font-display: swap + Cloud Subset Fonts (or switch theme icons to inline SVGs) |
cdn.your-site.com/.../*.woff2 blocked by CORS | Pull-CDN CNAME missing Access-Control-Allow-Origin header | Open 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?
Why does Lighthouse still flag a third-party iframe’s font (like YouTube Roboto or reCAPTCHA) even after fixing my site fonts?
Should I upload .ttf, .otf, .eot, or .woff2 when adding custom brand fonts to WordPress?
What if I serve local WOFF2 fonts via a Pull-CDN CNAME (cdn.example.com) and icons stop rendering?
Does KadiCache Cloud Font Subsetting support right-to-left (RTL) Arabic fonts like Cairo and Tajawal?
Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.
Configure local WOFF2 hosting, preconnect hints, and preload rules.
Shrink Latin & Arabic WOFF2 files and eliminate FOUT layout shifts.
Break HTML -> CSS -> WOFF2 serial dependency waterfalls.
Full overview of KadiCache’s Free Core + Cloud Pro font engine.