Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Web font swap causing layout shift (CLS): how to fix it

PRF-030Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

Your page asks the browser to download a custom font (for example from Google Fonts or a file on your own server). Until it arrives, the browser shows the text in a fallback font such as Arial or Times. When the web font lands, the browser swaps it in.

The two fonts rarely have the same letter widths, line height or spacing. Headlines wrap onto a different number of lines, paragraphs get taller or shorter, and every element below moves. Google counts this as Cumulative Layout Shift (CLS), a score for how much visible content jumps during loading. A score above 0.1 is rated as needing improvement.

How a font swap moves your form
  1. Page loadsText shown in fallback font
  2. Font file arrivesBrowser swaps to the web font
  3. Text reflowsHeadline wraps to an extra line
  4. CTA and form moveButton shifts down under the finger

The swap happens after the visitor has already started reading and aiming at the page.

Why it costs you leads or sales

A shift of a few dozen pixels is enough to move a button just as someone taps it. They may hit the wrong element, lose their place in a form, or simply feel the page is unstable. It hurts most on mobile, on slow connections and on first visits, when the font is not yet cached.

The impact is usually medium: it rarely breaks a funnel outright, but it adds friction on the pages where you pay for traffic. A poor CLS score can also count against you in Google's page experience signals.

Layout shift score by font setupExample numbers
Layout shift score by font setup (example)Late swap, default fallback: 0.2 CLS; Preloaded font: 0.1 CLS; Preload + matched fallback: 0 CLS0010.20.10Late swap, default fa…Preloaded fontPreload + matched fal…CLS

Example: illustrative scores for the same landing page with different font setups. Your numbers will differ.

How to check if your site has it

Confirm that fonts are the cause
  1. Run PageSpeed Insights

    Test your landing page on mobile. Under Diagnostics, open 'Avoid large layout shifts' and look at which elements shifted. Text blocks are a hint.

  2. Record a load in Chrome DevTools

    Open the Performance panel, enable 'Screenshots', throttle the network to Slow 4G, and reload. In the Experience row, click each red Layout Shift marker to see the moved nodes.

  3. Turn on layout shift highlighting

    In DevTools, open the Rendering tab and tick 'Layout Shift Regions'. Reload and watch for blue flashes over headlines and paragraphs.

  4. Compare with fonts blocked

    In the Network tab, right-click a font file and choose 'Block request URL'. Reload. If the shift disappears, the swap is the cause.

How to fix it

Three changes work together: load the font sooner, choose a sensible font-display value, and make the fallback font occupy the same space as the web font.

Fix the font swap
  1. Limit the fonts you load

    Keep to one or two families and only the weights you use. Fewer files means fewer swaps. Use WOFF2 files.

  2. Preload the key font files

    Preload only the one or two files used above the fold, such as the regular body weight and the headline weight.

  3. Set font-display

    Use swap to always show text quickly, or optional to avoid the swap on slow loads (the web font is used only if it arrives almost at once). optional gives the lowest shift.

  4. Match the fallback font to the web font

    Define a local fallback with size-adjust, ascent-override, descent-override and line-gap-override so line breaks stay the same after the swap.

  5. Reserve space for key elements

    Give headlines and buttons a min-height where wrapping could change their height.

Preload a self-hosted fonthtml
<link rel="preload" href="/fonts/inter-regular.woff2" as="font" type="font/woff2" crossorigin>
Web font with a metric-matched fallbackcss
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@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", Arial, sans-serif;
}
Where to make the change on your platform
  1. Host fonts locally

    Download the font as WOFF2, upload it through your theme or a child theme, and declare it in CSS with font-display. Many themes and block themes also have a Fonts setting in the Site Editor (Styles > Typography).

  2. Add the preload

    Add the preload link in header.php or through a hook on wp_head. Some performance plugins have a 'Preload fonts' field.

Font loading before and after

Before

  • Font requested late from a third-party stylesheet
  • Default Arial fallback with different widths
  • Headline changes from 2 to 3 lines on swap
  • Form and button jump down

After

  • Key font preloaded from your own domain
  • Fallback tuned with size-adjust and overrides
  • Headline wraps the same way in both fonts
  • Layout stays still

How to confirm it's fixed

Verification checklist
  • Reload with the cache disabled and Slow 4G throttling: no text block visibly jumps.
  • Layout Shift Regions shows no flashes over headlines or paragraphs.
  • PageSpeed Insights CLS is under 0.1 on mobile.
  • The Network tab shows the preloaded font starting early, with no second request for the same file.
  • Headlines wrap onto the same number of lines before and after the font loads.

How to prevent it happening again

Habits that keep fonts stable
  • Review font changes whenever the theme, brand fonts or page builder change.
  • Recalculate the fallback overrides when you swap a font family.
  • Add new weights only when a design really uses them.
  • Test pages with cache disabled after every redesign.
  • Avoid loading fonts through tag managers or late scripts.

How FunnelGuard handles this

FunnelGuard detects this issue only partly. It checks layout shift (CLS) on the funnel steps it visits. If a font swap pushes a page's CLS over the limit, you will see the shift flagged on that step.

It does not check fonts themselves. It does not tell you that the cause is a font swap, whether your fonts are preloaded, which font-display value you use, or whether the fallback metrics match. To cover that, use the DevTools checks above: block the font request and see whether the shift disappears, then review your @font-face rules and preload links.

FunnelGuard runs real customer journeys on a schedule from the EU or the US. A failure is re-checked from a second region before one alert goes out. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans start with a 3-day free trial.

Questions people ask

Why does my text jump when the page finishes loading?

The browser shows a fallback font first, then swaps to your web font once it downloads. If the two fonts have different widths or line heights, the text reflows and moves everything below it. This is counted as layout shift.

Does font-display: swap cause layout shift?

It can. swap shows text immediately in the fallback font and swaps later, so any difference in size causes a shift. Pair it with a preload and a metric-matched fallback, or use font-display: optional to avoid the swap on slow loads.

How do I stop Google Fonts from causing CLS?

Add display=swap to the Google Fonts URL, preconnect to fonts.gstatic.com, and reduce the weights you load. For the best result, self-host the WOFF2 files, preload the main ones and add a tuned fallback font.

What are size-adjust and ascent-override in CSS?

They are @font-face descriptors that scale a fallback font and adjust its vertical metrics. With the right values, the fallback takes up the same space as your web font, so the swap does not change line breaks or heights.

Should I preload all my fonts?

No. Preload only the one or two files used above the fold, usually the body and headline weights. Preloading too many competes with other critical resources and can slow the page.

Why don't I see the font shift on my own computer?

Your browser has the font cached after the first visit, so there is no late swap. New visitors on slower connections see it. Test with the cache disabled and network throttling in DevTools.

Is font-display: optional better than swap for CLS?

For layout stability, usually yes. With optional, the browser uses the web font only if it loads almost immediately, and otherwise sticks with the fallback for that page view. The trade-off is that some first visits show the fallback font.

Can FunnelGuard tell me a font swap is causing my CLS?

Only partly. FunnelGuard checks CLS on funnel steps and flags pages over the limit, but it does not inspect fonts or name the swap as the cause. You confirm that by hand with the DevTools checks in this guide.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: CLS only.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.