How to Fix Web Font Loading with font-display and Preload
When web fonts load without a font-display rule, browsers can hide text for up to 3 seconds while the font downloads. This is called a flash of invisible text. By the end of this guide, every font your pages load will use font-display: swap, and your one or two most important font files will be preloaded so they arrive early.

Why it matters
Invisible text delays First Contentful Paint and Largest Contentful Paint when the largest element is a heading or paragraph. Both metrics feed into Core Web Vitals and how fast your page feels to visitors. On slow mobile connections, people may see a blank page and leave before any words appear.
Preloading the main font also shortens the visible font swap and cuts the layout shift it causes. The ranking effect is small, but the fix takes minutes and improves every page that uses custom fonts.
What you need
Step-by-step fix
List every font file your pages load
com and press F12. Go to Network, click the Font filter, then reload with Ctrl+Shift+R (Cmd+Shift+R on Mac). Note each file name, its host and its size.
Next, open View Page Source and search for:
@font-facefonts.googleapis.comuse.typekit.net.woff2
This shows where each font is declared.
Add font-display: swap to self-hosted @font-face
Find every @font-face block in your theme or plugin CSS. Add font-display: swap; to each one. Every weight and style has its own block, so a font loaded in four weights needs the rule four times.
With swap, the browser shows fallback text right away and switches to the web font once it has loaded.
@font-face {
font-family: 'Example Sans';
src: url('/fonts/example-sans-400.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Example Sans';
src: url('/fonts/example-sans-700.woff2') format('woff2');
font-weight: 700;
font-style: normal;
font-display: swap;
}Add display=swap to Google Fonts and Adobe Fonts
For Google Fonts, add &display=swap to the end of the stylesheet URL. Google then writes font-display: swap into every @font-face it serves.
For Adobe Fonts, open fonts.adobe.com and go to My Adobe Fonts > Web Projects. Edit the project, set Font display to swap, then save.
Trim the URL to only the families and weights you use. Each extra weight is another download.
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap">
Preload the one or two critical font files
Preload only the fonts used above the fold, usually the body regular weight and the heading weight. Put the preload tags high in the <head>, before your stylesheets. The crossorigin attribute is required even for fonts on your own domain.
Without it, the browser fetches the file twice.
<link rel="preload" href="/fonts/example-sans-400.woff2" as="font" type="font/woff2" crossorigin> <link rel="preload" href="/fonts/example-sans-700.woff2" as="font" type="font/woff2" crossorigin>
Reduce the layout shift from the font swap
Pick a fallback font with similar proportions. You can also tune a local fallback font using size-adjust, ascent-override and descent-override so the swap barely moves text. Free fallback-font generators calculate these values for your specific font.
@font-face {
font-family: 'Example Sans Fallback';
src: local('Arial');
size-adjust: 104%;
ascent-override: 92%;
descent-override: 24%;
}
body { font-family: 'Example Sans', 'Example Sans Fallback', Arial, sans-serif; }Clear caches and verify the result
Purge your CDN, caching plugin and any optimization plugin caches. In DevTools Network, reload the page and check each font row:
- The Initiator column should show the preload link for your critical fonts.
- Each file should download only once.
Run Lighthouse in DevTools (Performance category) and confirm the font-display warning is gone. Then re-run the audit so it rescans all pages.
curl -s https://www.example.com/ | grep -Eo 'font-display:[^;]+|display=swap|rel="preload"[^>]*font[^>]*'
Platform-specific notes
WordPress
Block themes declare fonts in theme.json under settings.typography.fontFamilies[].fontFace. Add "fontDisplay": "swap" to each entry, because WordPress outputs "fallback" by default. With Elementor, go to Elementor > Settings > Performance (Advanced in older versions) and set Google Fonts Load to Swap. Add preload tags with a header-code plugin or with wp_head in a child theme.
Shopify
In theme.liquid, output theme fonts with {{ settings.type_body_font | font_face: font_display: 'swap' }}. Preload them with {{ settings.type_body_font | font_url | preload_tag: as: 'font', type: 'font/woff2', crossorigin: true }}. Dawn-based themes already do this; check older or custom themes.
Next.js
Use next/font/google or next/font/local. It self-hosts the files, sets font-display: swap by default and preloads fonts used on the page. Remove any manual Google Fonts <link> tags so fonts don't load twice.
Webflow
Custom fonts uploaded in Site settings > Fonts are output by Webflow. Check the published CSS for font-display and override it if needed. Add preload tags in Site settings > Custom code > Head code, using the font URL shown in the Network tab.
Wix
Wix controls font loading and @font-face output, so you cannot edit font-display or add font preloads. Limit the site to two font families and few weights, and rely on Wix's built-in optimization.
Check that it worked
✅ How to verify
- In the DevTools Network tab with the Font filter on, each critical WOFF2 file loads once, early in the waterfall, with the preload link as its initiator.
- View source or open the CSS files and confirm every @font-face contains font-display: swap and every Google Fonts URL ends with display=swap.
- Lighthouse no longer flags font display or invisible text during webfont load.
- Re-run the site audit and confirm the Web font loading check passes on all scanned pages.
⚠️ Common mistakes
- Leaving out the crossorigin attribute on font preloads, which makes the browser download the same font twice.
- Preloading every weight and style, which competes with the main image and CSS for bandwidth and can make LCP worse.
- Adding font-display to one @font-face block but missing other weights, or missing fonts injected by plugins and page builders.
- Fixing the theme CSS but forgetting to purge the CDN or optimization-plugin cache, so the old CSS keeps being served.
Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.
Check my site freeFAQ
Should I use font-display: swap or optional?
Use swap for brand and heading fonts that must eventually appear. Use optional when speed and zero layout shift matter more than the exact font: if the font isn't ready almost immediately, the browser keeps the fallback for that page view. Both remove invisible text.
Does font-display: swap cause layout shift?
It can cause a small shift when the web font replaces the fallback. Preloading the font and setting size-adjust on a matched fallback font keeps that shift to a minimum.
How many fonts should I preload?
Usually one or two: the files used for body text and headings above the fold. Preloading more takes bandwidth from more important resources.
Is it better to self-host Google Fonts?
Usually yes. Self-hosting removes connections to third-party servers, lets you preload the exact files and avoids sending visitor IP addresses to Google. Download the WOFF2 files, serve them from your domain and add font-display: swap yourself.
How to Fix Mobile-Friendly Rendering and Horizontal Scroll
How to Fix Third-Party Script Impact on Your Homepage
How to Fix JavaScript-Dependent Content for Crawlers and AI
How to Fix Unused JavaScript and Speed Up Mobile Pages
How to Fix Crawl Budget Waste from URL Parameters
How to Fix Too Many HTTP Requests on Your Web Pages