Fix guides · Performance
How to fix “Font display”: keep text visible while fonts load
Text that stays invisible until a web font downloads. How to set font-display: swap on Shopify, WordPress, Webflow, Wix, Squarespace and Next.js.
- Time to fix
- 15–30 minutes
- Skill needed
- Copy and paste
- Who notices
- Every visitor: text appears late, especially on slow connections
Why it matters
By default, browsers hide text for up to about three seconds while its web font downloads. Visitors see the page's layout with blank spaces where the words should be.
The font-display setting changes that. With swap, text appears straight away in a fallback font and switches when the web font arrives. With optional, the browser uses the web font only if it arrives very quickly.
“From the data displayed above, we can see that around 44% of both mobile and desktop sites use font-display:swap while 23% of sites use font-display:block.”
Before you start
- Your report lists each font file without a suitable font-display. Check where each one comes from: your theme, Google Fonts, an icon font from a plugin or app, or a widget.
- swap can make text shift slightly when the web font arrives. Choosing a fallback font of a similar size keeps that small.
- Fonts loaded by third-party widgets follow that service's settings, and you can't change them.
Fix it on your platform
Shopify
- Theme fonts from Shopify's font library are output with the font_face filter. Add font_display: 'swap' where your theme calls it (usually in layout/theme.liquid or a CSS snippet).
- For fonts you've uploaded yourself, add font-display: swap to their @font-face rules.
- Icon fonts added by apps follow the app's own settings.
{{ settings.type_header_font | font_face: font_display: 'swap' }}WordPress
- If your theme loads Google Fonts, check whether its typography settings or a font plugin offer a swap or "optimize font loading" option, or host the fonts locally.
- For fonts in your own CSS, add font-display: swap to each @font-face rule.
- Icon fonts from plugins (social icons, page builders) are a common cause. Check the plugin's settings, or swap it for one that uses SVG icons.
@font-face {
font-family: "Brand";
src: url("/fonts/brand.woff2") format("woff2");
font-display: swap;
}Webflow
- Open Site settings → Fonts. For each custom font, set the font display setting to swap.
- Webflow recommends uploading fonts as WOFF2 and, instead of using Google Fonts directly, downloading them and uploading them as custom fonts.
Wix
- Wix manages how its fonts load. What you control is which fonts you use.
- Use system fonts where you can, and keep to three fonts or fewer per page. If you upload a custom font, use WOFF2.
- In the Studio Editor, Wix suggests turning on Default Fonts if your main text uses a custom font.
Squarespace
- Squarespace manages how its fonts load. What you control is which fonts you use.
- Use fewer fonts: Squarespace suggests no more than two across the site. Web-safe fonts such as Arial, Georgia or Verdana need no download at all.
Next.js
- next/font uses font-display: swap by default. Load your fonts with it rather than with <link> tags or @font-face in global CSS.
- If a font is flagged, check for a stylesheet that loads it separately (an icon font, a widget, or a leftover Google Fonts link).
import { Inter } from "next/font/google";
const inter = Inter({ subsets: ["latin"], display: "swap" });Any other site
- Add font-display: swap to every @font-face rule you control.
- For Google Fonts, make sure the stylesheet address ends with &display=swap.
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap">“If you have many different fonts, all of them must load behind the scenes before the page can appear in the browser.”
Check that it's fixed
- Re-run your StudioLNC audit: the font files you changed should no longer be listed.
- Load your site on a slow connection (Chrome DevTools → Network → Slow 4G) and check text appears straight away.
Find every issue like this on your site
Free audit of performance, accessibility, SEO and security, with fixes for your platform.