font-display swap usually helps LCP when your largest element is text, because the browser paints that text right away in a fallback font instead of hiding it. It hurts when the late font swap shifts the layout (CLS), or when preloading fonts steals bandwidth from an LCP image. For many sites, font-display optional with one preloaded font is the safer choice.
Almost every PageSpeed report I open for a WordPress site has some advice about fonts. “Ensure text remains visible during webfont load” is the classic one, and the usual fix people copy from a blog post is to add font-display swap everywhere. Sometimes that’s exactly right. Sometimes it trades one problem for another.
This post explains what font-display swap actually does, how it affects Largest Contentful Paint and layout shift, when another value works better, and how I set fonts up on WordPress sites so they don’t hold back Core Web Vitals. Everything here is based on the browser documentation from MDN and web.dev, which I link as I go.
Table of Contents
What does font-display swap do?
When a page uses a web font, the browser has to download the font file before it can draw text in that font. The font-display descriptor in your @font-face rule tells the browser what to do while it waits.
MDN’s font-display reference describes a timeline with three periods. During the block period, text that uses the font is drawn invisibly. During the swap period, text is drawn in a fallback font, and the web font replaces it when it arrives. After that comes the failure period, where the browser gives up and keeps the fallback.
font-display swap gives the font an extremely small block period and an infinite swap period. In plain terms: show the text immediately in a fallback font, and swap in the real font whenever it finishes downloading, no matter how late that is.
Here’s what it looks like in CSS:
@font-face {
font-family: "Inter";
src: url("/fonts/inter-var.woff2") format("woff2");
font-weight: 100 900;
font-style: normal;
font-display: swap;
}
All five font-display values compared
font-display swap is only one of five values. The web.dev guide to font best practices lists the block and swap periods for each one:
| Value | Block period | Swap period | What the visitor sees |
|---|---|---|---|
| auto | Set by the browser | Set by the browser | Often similar to block |
| block | 2 to 3 seconds | Infinite | Invisible text, then the web font |
| swap | 0 ms | Infinite | Fallback text at once, then a swap |
| fallback | 100 ms | 3 seconds | Short wait; late fonts are skipped |
| optional | 100 ms | None | Web font only if it is ready almost at once |
web.dev sums up the trade-off well: font-display swap delays text rendering the least, but you get a jarring shift if the font arrives late. Optional delays text by no more than about 100 milliseconds and guarantees no font-swap layout shift, but the web font won’t be used on that page view if it arrives late.

How does font-display swap affect LCP?
Largest Contentful Paint measures when the biggest piece of content in the viewport is drawn. On many pages that’s a hero image. On plenty of others, especially blogs, service pages and landing pages with a big headline, it’s a block of text.
This is where fonts matter. According to web.dev’s LCP documentation, text nodes that use web fonts aren’t treated as rendered during the font block period. So if your hero headline uses a font with a long block period, the browser can’t count it as painted until the font arrives or the block period ends.
font-display swap removes that wait. The headline is painted straight away in the fallback font, and that first paint is what counts. When the web font arrives later, the text is redrawn, but web.dev also notes that changes to an element’s size or position don’t create new LCP candidates. In most cases, the early paint stands.
So the simple version is: when the LCP element is text, font-display swap usually helps LCP, sometimes a lot, especially on slow mobile connections where a font file can take a while to arrive.
When the LCP element is an image
If your largest element is a hero image, font-display swap does very little for LCP directly. The image is what you need to speed up. Fonts can still slow it down indirectly, which brings us to the cases where swap, or the way people apply it, hurts.
When font-display swap hurts
font-display swap isn’t free. These are the situations where I see it cause problems.
1. Layout shift when the font arrives
The fallback font and your web font almost never have the same size. When the swap happens, lines get longer or shorter, headings wrap differently, and everything below them moves. That movement counts toward Cumulative Layout Shift. web.dev warns that auto, block, swap and fallback all have the potential to cause layout shifts when the font is swapped.
On a page where the swap happens after the visitor has started reading, it’s also just annoying. Text jumps, buttons move, and people lose their place.
2. Preloading too many fonts
A common fix for a late swap is to preload the font so it arrives sooner. That works for one or two files. Preload every weight and style, though, and those downloads compete with your hero image, CSS and scripts. web.dev notes that preload takes browser resources away from other files. If your LCP element is an image, too many font preloads can make LCP worse, even with font-display swap set.
3. Icon fonts
Icon fonts are a bad match for swap. During the swap period, the browser shows the fallback font, which means visitors briefly see random letters or empty boxes where icons should be. For icon fonts, block or an SVG icon set is a better choice.
4. A swap that arrives very late
Because the swap period is infinite, a slow font can swap in seconds after the page looked finished. For most text that’s fine, but on a page where the layout is very sensitive to text width, a very late swap can be worse than never swapping at all.
font-display optional: the safer default for many sites
For many sites I now prefer font-display optional for body text. The browser waits up to about 100 milliseconds. If the font is there, it’s used. If not, the fallback stays for that page view, and the font is cached for the next page. No late swap, so no font-related layout shift.
The downside is that first-time visitors on a slow connection may see the fallback font. For body text that’s rarely a problem. For a brand headline font, some clients won’t accept it.
web.dev’s article on preloading optional fonts describes the best version of this: combining preload with font-display optional is the most effective way to guarantee no layout jank. Since Chrome 83, a preloaded optional font can be used on the first render if it arrives within the short timeout, without a visible swap.
<link rel="preload" href="/fonts/inter-var.woff2" as="font" type="font/woff2" crossorigin>
@font-face {
font-family: "Inter";
src: url("/fonts/inter-var.woff2") format("woff2");
font-weight: 100 900;
font-display: optional;
}
Note the crossorigin attribute on the preload. Font requests use CORS, so without it the browser may download the font twice.
font-display swap vs optional: which should you use?
There’s no single right answer, but this is the decision I make on most sites:
| Situation | My choice | Why |
|---|---|---|
| LCP is a text headline, brand font matters | font-display swap + fallback metrics | Fast text paint; metrics reduce the shift |
| Body text on a content site | optional + one preload | No layout shift; cached for the next page |
| LCP is a hero image | swap or optional, preload few fonts | Keep bandwidth free for the image |
| Icon font | block, or switch to SVG icons | Avoid flashes of random characters |
| System font stack | Nothing to set | No web font, no swap |

Fix the swap shift with fallback font metrics
If you keep font-display swap, the best way to cut the layout shift is to make the fallback font take up the same space as the web font. web.dev suggests the size-adjust descriptor for this. Along with ascent-override, descent-override and line-gap-override, it lets you tune a local fallback font so the swap barely moves anything.
@font-face {
font-family: "Inter Fallback";
src: local("Arial");
size-adjust: 107%;
ascent-override: 90%;
descent-override: 22%;
line-gap-override: 0%;
}
body {
font-family: "Inter", "Inter Fallback", sans-serif;
}
The numbers above are an example, not values to copy. The right percentages depend on your web font and the fallback you pick. Some frameworks and font tools calculate them for you. Test by loading the page with the web font blocked and comparing line breaks.
Setting font-display swap in WordPress
How you change font-display on a WordPress site depends on where the fonts come from. Here are the common cases.
Google Fonts loaded from Google
The Google Fonts CSS API accepts a display parameter, so &display=swap at the end of the stylesheet URL sets font-display swap for every font in it. Many themes already add it. You can also use display=optional.
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap">
Fonts in a block theme (theme.json)
Block themes register fonts in theme.json, where each fontFace entry maps to @font-face descriptors. WordPress prints those rules with wp_print_font_faces(), and its documented default for font-display is fallback, not swap. If you want a different value, set fontDisplay on each font face.
{
"fontFamily": "Inter",
"slug": "inter",
"fontFace": [
{
"fontFamily": "Inter",
"fontWeight": "100 900",
"fontStyle": "normal",
"fontDisplay": "swap",
"src": [ "file:./assets/fonts/inter-var.woff2" ]
}
]
}
Page builders and performance plugins
Many page builders, themes and optimization plugins have a setting for font display or for hosting Google Fonts locally. Check what each one outputs in the page source. I’ve seen sites where the theme, the builder and a plugin each load the same font family with different font-display values, so the browser downloads several copies.
Self-hosting fonts
Self-hosting removes the connection to a third-party server and gives you full control over font-display, file format and preloading. web.dev’s guidance is that self-hosting is often faster, but not automatically, so pair it with WOFF2 files, subsetting and good caching. I cover the rest of the speed basics in my WordPress PageSpeed checklist.
Should you preload fonts in WordPress?
Preload one or two fonts at most: the ones used above the fold, usually the heading font and the main body weight. Use WOFF2 only. Don’t preload italic or bold styles unless they appear in the first screen.
Also check that the URL you preload is exactly the URL the CSS requests. A mismatch, such as a different version query string, means the browser downloads the font twice and wastes the preload. In WordPress that’s easy to get wrong when a plugin adds version numbers to font URLs.
add_action( 'wp_head', function () {
$font = get_theme_file_uri( 'assets/fonts/inter-var.woff2' );
printf(
'<link rel="preload" href="%s" as="font" type="font/woff2" crossorigin>' . "\n",
esc_url( $font )
);
}, 1 );
How to test whether font-display swap helped
Don’t judge a font change from one Lighthouse run. This is how I check:
- Find the LCP element first. In PageSpeed Insights or Chrome DevTools, check whether it’s text or an image. If it’s an image, fonts are a secondary fix.
- Run the Performance panel with network throttling and watch when the headline first appears and when the font swaps.
- Look at layout shifts in the same recording. A shift right when the font arrives means you need fallback metrics or optional.
- Check the field data after a few weeks, because real visitors matter more than lab runs.
- Compare against the thresholds: good LCP is 2.5 seconds or less, and good CLS is 0.1 or less.
If you want the full explanation of how those numbers are measured, read my guide to Core Web Vitals thresholds.
Common font mistakes I fix on WordPress sites
- Loading six or more font weights when the design uses two or three.
- The same family loaded twice, once from Google and once self-hosted by a plugin.
- Preloading every font file, so fonts compete with the hero image.
- Icon fonts with font-display swap, showing random letters on slow connections.
- No fallback metrics, so font-display swap causes a visible jump in the hero.
- Old TTF or WOFF files instead of WOFF2, which web.dev says compresses about 30% better than WOFF.
Most of these take minutes to fix once you find them. Finding them is the hard part, because they’re spread across the theme, the builder and plugins.
Who doesn’t need to worry about font-display swap
If your site uses a system font stack, there’s no web font to wait for and nothing to swap. The same goes for sites where fonts are already cached, small, preloaded and loaded with optional, and the field data for LCP and CLS is good. Don’t chase a PageSpeed suggestion if real users already have a fast, stable page.
font-display swap is also a small lever compared with the big ones: server response time, image size, render-blocking CSS and heavy scripts. If your LCP is four seconds because of a slow host and a three-megabyte hero image, no font setting will save you.
Frequently asked questions
Does font-display swap improve LCP?
Often, when the LCP element is text. font-display swap paints text right away in a fallback font, and text that uses web fonts isn’t counted as rendered during the block period. If the LCP element is an image, the effect is small.
Does font-display swap cause CLS?
It can. When the web font replaces the fallback, differences in size and spacing can move content. Matching the fallback with size-adjust and the override descriptors, or using font-display optional, reduces or removes that shift.
Is font-display optional better than swap?
For body text and for layout stability, often yes, especially with one preloaded font. For a brand headline font that must always show, font-display swap with tuned fallback metrics is usually the better choice.
How do I add font-display swap to Google Fonts?
Add the display parameter to the Google Fonts stylesheet URL, for example display=swap at the end of the css2 URL. Many WordPress themes already include it.
What font-display value does WordPress use by default?
WordPress’s wp_print_font_faces() function, which outputs fonts registered by block themes, documents fallback as its default. You can change it with the fontDisplay property in theme.json.
Should I preload fonts in WordPress?
Preload only the one or two WOFF2 files used above the fold, with the crossorigin attribute. Preloading many fonts can slow down the hero image and other critical files.
Want your fonts and Core Web Vitals fixed?
I clean up font loading as part of WordPress speed work: removing duplicate font files, setting the right font-display value per font, adding fallback metrics and preloading only what’s needed. See my WordPress speed optimization service, which starts at $79 for a small site, or send me your URL and I’ll tell you whether fonts are actually what’s slowing it down.
