Font display in Lighthouse: which fonts to fix, and where

A web font can hide your text while it downloads and move the page when it arrives. Which fonts on the list are worth the work, and where the setting is on WordPress, Shopify and in your own CSS.

Arjen Karel
Updated · 9 min read
Share

What does "Consider setting font-display to swap or optional" mean?

Font display is the Lighthouse notice that starts "Consider setting font-display to swap or optional" ("Ensure text remains visible during webfont load" before Lighthouse 13). The CSS setting font-display decides what shows while a web font downloads, and yours hides the text. Set font-display: swap on your first-screen fonts and resize the fallback font, which shows first, so nothing moves.

Just want the quick fix? Jump to WordPress, Shopify, Google Fonts or your own CSS.

Which font-display values does Lighthouse flag?

The notice reads: "Consider setting font-display to swap or optional to ensure text is consistently visible. swap can be further optimized to mitigate layout shifts with font metric overrides."

Lighthouse lists every web font (a font file your page downloads) whose font-display value is block, fallback or auto, or that has no value. Swap and optional clear the notice. Fonts you never added are listed too, such as a plugin's Google Fonts.

The screenshot comes from a test page I built: the product page of a hiking boot, with a narrow headline font and a large text font.

Lighthouse 13.6.0 report, the Font display notice expanded: Est savings of 2,930 ms, labels FCP and Unscored, two fonts listed: InterVariable.woff2 at 2,930 ms and BarlowCondensed-Bold.woff2 at 790 ms

Lighthouse 13.6.0 on a phone, DevTools throttling: Slow 4G and a 4x slower CPU.

  • Est savings is how long the font took to download. PageSpeed Insights records the load at full speed, so there it is often small.
  • Unscored means the notice gives no points, but hidden text delays LCP and Speed Index, a moving page adds CLS, and those count.

What do visitors see while a web font loads?

Your visitors see gaps where the headline and the description go, then text that appears late or changes font. A system font is on the device, but a web font is a download that starts late, because the browser requests it only once the HTML and the CSS say visible text needs it.

Until it arrives, the font-display value decides what Chrome shows. The fallback font is the next font your CSS names.

  • block: text hidden up to 3 seconds from the font request.
  • auto, or no value: text hidden up to 2 seconds after the page load started.
  • fallback: text hidden 100 ms, then the fallback font.
  • swap: the fallback font at once, the web font when it arrives.
  • optional: the fallback font at once, the web font only if it arrives before the first render or is in the cache.
Product page at the first paint with font-display block: header, breadcrumbs and star rating, a blank gap where the headline goes and nothing under the photo

Before: block

The same page at the first paint with font-display swap: the headline and the description are there in Arial

After: swap

The hiking boot page at its first paint. The dark box is the photo, still loading.

Does a web font slow down LCP or move the page?

Hidden text can't be the LCP element, the largest thing on the first screen, so a heading or paragraph as LCP waits for the font. With the photo of the hiking boot page moved below the first screen, the description became the LCP: 3.6 s with block, 0.6 s with swap. Back in place, the photo is the LCP, at 2.1 s with each setting in the table below.

When the web font replaces the fallback font and the lines break differently, everything below moves, with block, auto and swap alike. So swap passes the notice and keeps the layout shift. Metric overrides resize the fallback font so nothing moves.

Product page with font-display swap before the headline font arrives: the headline takes three lines in Arial

Swap, before

The same page after the headline font arrived: the headline takes two lines and the photo moved up, a dashed outline shows where it was

Swap, after

Product page with metric overrides before the headline font arrives: the fallback headline takes two lines

Overrides, before

The same page after the headline font arrived: two lines, nothing moved

Overrides, after

With swap the headline goes from three lines to two and the photo moves up from the dashed outline. With overrides it keeps two lines.

The Layout shift culprits notice lists the photo for that shift, with the causes "Unsized image element" and "Web font". The photo has a width and a height, so act on the font.

Headline
readable
Description
readable
CLS
block1.43.60.031
swap0.60.60.031
swap with
overrides
0.60.60
optional,
preloaded
0.70.70

Seconds until the text shows in either font, median of five loads on a throttled phone, this test page only.

Lighthouse labels this notice FCP (First Contentful Paint, the first moment anything shows), but Chrome reports FCP while the text is hidden, so the gain shows in Speed Index, and in LCP where text is the LCP.

Which flagged fonts are worth fixing?

  • Fix: the font of your LCP text (the LCP breakdown notice names the element), fonts for first-screen text, and any font that moves something.
  • Can stay on the list: a font for text far below the first screen, a font with the value fallback on a page that doesn't move, and a widget's font.

With one or two font files, sites have a good LCP about equally often whatever the font-display value: see the chart below. That is a correlation.

How do you fix the Font display notice?

The URL in the list says where the font comes from, and so where the setting is. Remove font files first, set swap there, then stop any shift.

The URL holdsThe font comes from
/wp-content/themes/your WordPress
theme
/wp-content/plugins/a plugin or
page builder
/uploads/fonts/the WordPress
Font Library
/cdn/fonts/your Shopify theme
fonts.gstatic.comGoogle Fonts
use.typekit.netAdobe Fonts
/_next/Next.js
another path
on your domain
your own stylesheet
another domaina widget or
third-party script

Fewer and smaller font files

Remove the weights and families you don't use in your theme's font settings. A system font means no download at all, and Shopify's font picker has a System fonts group.

Bar chart: share of sites with a good LCP on phones by number of font files, sites with only swap or optional against sites with only block, auto or fallback. The gap is small with few files and grows with more files

Sites with a good LCP on phones. Data: State of Web Vitals, November 2026, 61,136 sites.

According to the State of Web Vitals, 88% of sites with one or two font files and only swap or optional have a good LCP on phones, against 81% with eleven or more files. With only block, auto or fallback it is 87% against 72%. That is a correlation.

A developer can also remove the characters your languages don't use (a subset). On the hiking boot page that took the text font from 344 KiB to 51 KiB: it arrived 1.7 s earlier and the photo, on the same connection, 0.15 s earlier.

pyftsubset InterVariable.woff2 --unicodes="U+0020-007E,U+00A0-00FF,U+2013,U+2014,U+2018-201D,U+2026,U+20AC" --layout-features="kern,liga,calt,ccmp,locl,mark,mkmk" --flavor=woff2 --output-file=inter-latin.woff2

Check your languages, because a character outside the subset shows in the fallback font.

WordPress

Without code:

  • Google Fonts: the OMGF plugin can force swap. WP Rocket's Optimize Google Fonts adds swap and is on by default. Perfmatters has Display Swap under Fonts.
  • Elementor: set Google Fonts Load to Swap, on the Advanced tab of its settings.
  • All fonts in your CSS: Font Display Optimization in LiteSpeed Cache, or OMGF Pro. Icon fonts get swap too, so look at your icons.

A font from theme.json or the Font Library, as on Twenty Twenty-Four and Twenty-Five, gets the value fallback unless the theme names another: 100 ms of hidden text, which can stay if nothing moves.

Without a setting it is a small job for a developer: send the font's URL and this section. In a block theme, set fontDisplay per font in the theme.json of a child theme, and list every font you keep, because its list replaces the parent's. In a classic theme the @font-face rule goes in the child theme. A parent theme update removes edits made in it.

"fontFace": [{
  "fontFamily": "Barlow Condensed",
  "fontWeight": "700",
  "fontStyle": "normal",
  "fontDisplay": "swap",
  "src": ["file:./assets/fonts/barlow-condensed-700.woff2"]
}]

A second @font-face with swap under the same family name in Additional CSS clears the notice while the block rule keeps your text hidden. Give the new rule its own family name and set that name on the text.

Shopify

Shopify's Dawn and Horizon themes already set swap, so a listed font comes from an older theme, pasted code or an app. Replace pasted code with a font from the theme settings, and switch app embeds off one by one, with a Lighthouse run after each. An older theme needs one line per font under Edit code, which any Shopify developer can add:

{{ settings.type_header_font | font_face: font_display: 'swap' }}

A theme update keeps code edits unless they conflict, and then Shopify says so.

Google Fonts and Adobe Fonts

Lighthouse lists fonts.gstatic.com, and the setting goes on the fonts.googleapis.com/css2 link: your theme's font setting, a plugin from the WordPress list, or &display=swap in code. Hosting the font yourself removes two domains.

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700&display=swap">

For Adobe Fonts, open your web project on fonts.adobe.com, choose Edit Project and set the value in the sidebar. The default is auto.

Your own stylesheet and Next.js

Your own stylesheet has no setting: send a developer the URL from the list and ask for font-display: swap in every rule for that file. Searching all files for the file name under Sources in DevTools finds every rule.

@font-face {
  font-family: "Barlow Condensed";
  src: url(/fonts/barlow-condensed-700.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
}

next/font gives you swap, a preload and an adjusted fallback font by default, so a listed font has another display value in that call or came in another way.

Fonts you can't or shouldn't change

  • An icon font shows letters or boxes with swap. In Elementor switch on Inline Font Icons. Elsewhere a developer replaces it with SVG, or our WordPress plugin holds it back. Otherwise leave it on block.
  • A plugin or app's font: send its developer the URL and ask for swap.
  • A third-party script's font: load the script later or leave it on the list.

swap or optional?

swapoptional
Layout shiftYes, unless the
fallback font
is matched
No
Web font on a
slow first visit
Yes, lateNo, the fallback
font stays

Use swap for your brand's fonts, with a matched fallback font, and optional where a system font is fine.

A preload in the HTML starts a font earlier. Preload one or two, the font of your largest first-screen text first, and check LCP afterwards: each preload takes bandwidth from your LCP image and can delay the first render up to 100 ms.

<link rel="preload" href="/fonts/barlow-condensed-700.woff2" as="font" type="font/woff2" crossorigin>

Keep crossorigin, also on your own domain, or the font downloads twice.

Stop the layout shift with metric overrides

Metric overrides resize the fallback font to the web font's measurements, so the lines break in the same place and nothing moves. No plugin has a setting for this, and Next.js does it for you. On WordPress the rule goes in Additional CSS, on Shopify in the theme's stylesheet under Edit code. The work is finding the numbers: send this section to a developer or do it yourself.

  1. Write one rule per font already on the device. Fontaine and Capsize calculate starting numbers, and Chrome's article has the formula.
  2. Block the font file in DevTools (Network, right click, Block request URL) and reload at phone width.
  3. Compare the line breaks with a normal load and change size-adjust until they match.
@font-face {
  font-family: "Barlow Fallback Arial";
  src: local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 700;
  size-adjust: 68.32%;
  ascent-override: 146.37%;
  descent-override: 29.27%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Barlow Fallback Roboto";
  src: local("Roboto Bold"), local("Roboto-Bold"), local("Roboto");
  font-weight: 700;
  size-adjust: 73.5%;
  ascent-override: 136.05%;
  descent-override: 27.21%;
  line-gap-override: 0%;
}
h1 {
  font-family: "Barlow Condensed", "Barlow Fallback Arial", "Barlow Fallback Roboto", sans-serif;
}

size-adjust scales the letters and the three -override values set the line height. Safari applies only size-adjust, so there the line height can differ a little. Android has no Arial, so it uses the Roboto rule. Measure on your own text: on the hiking boot page Arial at the calculated 97.6% gave the description five lines against six in the web font, and the buy button still moved. At 101% both took six.

Font still listed or page still moving after swap?

Run Lighthouse again. Still on the list:

With optional, the report's screenshot shows the fallback font, and that is optional working. If the font passed and the page still moves, the fallback font needs metric overrides.

For real visitors, open LCP by element on mobile in CoreDash. A heading or paragraph near the top of that table means a font can delay your LCP, so follow that row after the fix. Search Console shows the change later.

CoreDash table of LCP by attribution element, sorted by sessions: h1.product-title in the top row and the product photo img.hero in the second

Sorted by sessions.

A theme, page builder or app can add a font in a file you can't edit. During a Core Web Vitals power hour we follow that file back to what loads it, and you know which setting to change and what to ask the vendor.

About the author

Arjen Karel is a web performance consultant and the creator of CoreDash, a Real User Monitoring platform that tracks Core Web Vitals data across hundreds of sites. He also built the Core Web Vitals Visualizer Chrome extension. He has helped clients achieve passing Core Web Vitals scores on over 925,000 mobile URLs.

 
Arjen Karel

Need a faster site?

I'm Arjen, and I've been fixing slow sites for 17 years. If you're running into issues you can't fix yourself, send me your URL and let's have a chat.

Send me your URL
Arjen Karel
Arjen Karel, Web performance consultant since 2009

Why isn't our fix working?

Sometimes the CDN still serves the old HTML, or the fix went into the desktop template and mobile uses another one. Send me your URL and the problem, and I reply with a few times. I check your field data first, then we spend one hour on your site, and within a day you have my notes in writing. €350 excl. VAT.

Send me your URL

No developer to build the fix? I do the work myself, on a copy of your site.

Arjen KarelCore Web Vitals still red on mobile?Send me your URL