94,251,097,328,344+.
Yes, you counted the commas correctly (It took me some time as well, don’t worry)--Google Fonts have been viewed over 94 TRILLION times across the web.
However, as popular and optimized as they are, how they are implemented on a WordPress site can make a big difference in loading speed.
That said, if you’re seeing slow load times from fonts.googleapis.com or fonts.gstatic.com in your DevTools waterfall, or your PageSpeed Insights report sends back warnings like “Ensure text remains visible during webfont load” and “Enable text compression”, this article will walk you through exactly how to fix all of that.
Read on.
Why is that important?
Understanding how things work in the background will allow you to easily identify what causes the issue and which optimization will bring immediate results.
That said, here’s how browsers handle font files and why sometimes there might be issues:
When a user visits your website, the browser starts by downloading the HTML. As it parses the page, it encounters CSS rules that reference external fonts, like those from Google Fonts. It then needs to pause rendering, fetch the font files, and apply them to the text.
What are render-blocking resources?
Render-blocking resources are elements, typically CSS and JavaScript files, that hinder the rendering or display of a webpage. When the browser encounters them, it must download, parse, and execute them before doing anything else.
This process can cause delays in how quickly text appears on screen.
If the font isn’t loaded yet, some browsers hide the text (also known as a Flash of Invisible Text, or FOIT).
Others might display fallback fonts first and then switch, causing layout shifts.
Now here’s the good news:
Google Fonts are actually built with performance in mind:
But, despite all these optimizations, performance issues can still happen if fonts are used carelessly.
Loading too many font families or weights can result in multiple, separate network requests. This not only increases load time but also blocks text from rendering. Large font files — especially those containing many styles or characters — can have a noticeable impact on page speed.
That’s why optimization isn’t just a nice-to-have. Even with a well-optimized service like Google Fonts, it’s crucial to use fonts intentionally and efficiently.
Let’s look at the best practices to help you do that.
A font family is a typeface like Roboto, Inter, or Lato. Within each family, you’ll find font weights (the thickness of the letters) like 400 (regular), 700 (bold), or even 300 (light).
What many site owners don’t realize is that every combination, like Roboto 400, Roboto 700 italic, or Lato 300, is a separate file. The browser needs to download each file before your text renders properly.
That means more network requests, longer load times, and slower experiences for your visitors, especially on mobile or slower networks.
While not using different fonts and weights may sound limiting, the truth is: you probably don’t need that many.
In fact, most well-designed sites get by just fine with one font family and two weights, usually 400 for body text and 700 for headings.
That said, here’s how to make sure you don’t load any unnecessary families or weights with Google Fonts:
1. Go to Google Fonts and search for the typeface you want. For this example, I’m going to use Roboto.
2. After you click “Get font,” you will be redirected to your cart to download the file or get an embed link. We’re going to embed the link directly.
3. Copy the embed code and adjust it. The original code looks like this:
This URL loads all combinations of Roboto:
Unless you're explicitly using all these variations (which is rarely the case), this significantly slows down your page.
That’s why you need to trim down the code and remove all unnecessary weight. Let’s say you will need regular weight (400) and bold weight (700). The optimized link would look like this:
This trimmed version drastically reduces font loading time and improves site performance without sacrificing the typography quality you need.
4. Add that embed code to your WordPress theme manually. You have two options:
5. Review your CSS to avoid referencing unused weights. For example, if you’ve only loaded 400 and 700, don’t write font-weight: 300; or use styles that depend on italic unless you’ve included those variants too. Using unsupported styles can cause the browser to substitute fallback fonts, which might look inconsistent.
Pro Tip
Designers love variety, but users love speed. Keep your typography system lean and purposeful. Most great sites only use one or two weights consistently.
Google Fonts is fast, but you can make it even faster and more privacy-friendly by hosting the fonts directly on your own server. This eliminates external requests to Google's CDN, reduces DNS lookups, and allows browsers to cache the fonts more effectively.
Self-hosting also lets you take complete control of your fonts. You can subset them (include only the characters you actually use), compress them for smaller sizes, and even help comply with privacy regulations like GDPR by preventing third-party data requests.
Here’s how to self-host Google Fonts:
Step 1: Download the Fonts You Need
Step 2: Upload Fonts to Your Server
Your theme structure should look like this:
Step 3: Add Fonts to Your CSS
In your theme’s CSS file (style.css), add the following @font-face rules:
Step 4: Use the Font in Your CSS
Now, simply reference your self-hosted font in your CSS as you normally would:
Step 5: Remove the Google Fonts External Call
Don’t forget to delete or comment out any external links to Google Fonts in your theme files (header.php or functions.php). You're now fully self-hosted!
Getting back to what happens in the background, when your site loads, your fonts don’t appear instantly because the browser has to fetch them first. And during that delay, what the user sees depends on a single CSS property – font-display.
The font-display property tells the browser how to handle text while waiting for a font to load.
Should it hide the text until the font is ready? Show fallback text immediately? Wait a little, then decide?
Applying this property to your font files lets you control this behavior and dramatically improve the user’s experience, especially on slow connections.
And there are four font-display options to choose from:
1. font-display: swap – shows fallback text immediately, then swaps in the custom font once it’s loaded.
✅ Prevents invisible text (FOIT / Flash of Invisible Text).
✅ Feels faster to users.
❌ May cause a small layout shift once the font swaps in.
2. font-display: block – hides the text for up to 3 seconds while waiting for the custom font.
✅ Ensures consistent layout once loaded.
❌ Risk of blank text (FOIT), especially on slow connections.
3. font-display: fallback – shows fallback font immediately. If the custom font loads quickly, it swaps in. If not, it stays with fallback.
✅ Balanced approach.
❌ Font may not appear at all if loading is slow.
4. font-display: optional – бehaves like fallback, but deprioritizes loading the custom font entirely.
✅ Great for performance-focused sites.
❌ Font might not load at all — depends on connection and device conditions.
For most websites, the best choice is font-display: swap.
Why?
Because it avoids the Flash of Invisible Text, improves perceived performance, and still gives users the benefit of your custom font once it’s ready.
Here’s how to use font-display in your project:
1. Self-hosting fonts
If you're self-hosting your fonts, simply include font-display in your @font-face declarations:
2. Using the embed link
If you're using Google Fonts via their embed link, they already include font-display: swap in the URL by default — just make sure it’s there:
Pro Tip
To reduce the chances of layout shifts when the browser swaps between the fallback font and your custom one:
When your site loads, the browser doesn’t automatically know which resources are most important. Priorities depend on the resource type (e.g., text, image, stylesheet, script, video) and the placement of the resource reference in the document.
That means your fonts might not start downloading until late in the page load process, especially if they’re declared deep in your stylesheets.
That’s where resource hints and preloading come in.
Link rel=preload is a powerful directive you can implement to give the browser a heads-up: “This font is critical, start loading it sooner.”
Important: Use this directive sparingly and only for late-discovered resources that are critical for the above-the-fold experience.
Preloading is especially useful for fonts used in above-the-fold content like headers, navigation, and hero sections – the parts users see first. Also, it can positively impact metrics like Interaction to Next Paint (INP), Largest Contentful Paint (LCP), and Cumulative Layout Shift (CLS).
Here’s how to preload your font files:
If you're self-hosting fonts, place the following tag inside your head before your main stylesheet loads. That way, the font begins downloading early in the page lifecycle:
Here’s what each part does:
If you’re using the embed link to load your font files, applying preloading is a bit complex. And to be honest, it can lead to more issues than gains, so it’s not worth the effort.
Pro Tip: Combine preload with font-display: swap
Preload gets your font downloading early, and font-display: swap ensures your text is visible right away. Used together, they create the best blend of speed, stability, and user experience.
Just like preload, preconnect is another type of resource hint, and it’s especially useful if you’re embedding Google Fonts using their default CDN link rather than self-hosting the files.
While preload gives self-hosted fonts a head start, preconnect helps when you don’t control the font files directly, like when loading them from fonts.googleapis.com.
It tells the browser: “Go ahead and set up the connection to this domain early — we’ll need it soon.”
That means the browser can start the DNS lookup, TCP handshake, and TLS negotiation right away — before it even encounters the actual request for the font CSS or font file. This can shave off precious milliseconds, especially on first visits.
How to use preconnect with Google Fonts:
If, for some reason, the Google Fonts’ embed code doesn’t include link rel=preconnect (which would be weird), you’ll want to preconnect to both domains involved in Google Fonts delivery:
Make sure to always include crossorigin for fonts.gstatic.com to ensure the browser handles CORS properly. Furthermore, these should be placed before your Google Fonts embed code — ideally at the top of your head section.
Good to know:
Unlike preload, which is a directive, preconnect is just a hint. The browser decides whether and when to act on it based on available resources and current priority.
Every font file you load doesn’t just contain the letters you see on your screen. It often includes entire alphabets, symbols, and special characters, sometimes across multiple languages. That’s great for versatility, but not so great for performance.
If your site doesn’t need all those extra characters, you’re sending unnecessary data to every visitor. And that means longer load times and wasted bandwidth.
That’s where font subsetting comes in.
Subsetting is the practice of stripping out everything your site doesn’t use — leaving only the essential characters, like the basic Latin alphabet, numbers, or a custom set of glyphs. It’s one of the most effective ways to shrink font file sizes and speed up text rendering.
This is especially important for:
By subsetting your fonts, you’re delivering only what’s needed, nothing more. That means faster sites and a smoother user experience.
How to subset your fonts:
If you're self-hosting your fonts, there are two ways to optimize them:
1. The easy way
If you're using NitroPack, font subsetting is handled for you automatically. It detects which characters your site uses and delivers a custom, lightweight version of each font — no manual setup, no code changes. This is ideal if you want performance without getting into the weeds.
2. The manual way
If you prefer a hands-on approach, you can generate custom subsets using tools like:
Then, you need to update your files.
What’s the point of building your website on WordPress and having access to thousands of plugins if you’re going to apply optimizations manually?
It doesn’t make sense.
And you don’t have to.
As I mentioned, NitroPack can handle font subsetting automatically, but that’s just one part of what it does. NitroPack includes several font-specific optimizations that work together to improve load times and visual stability, all without requiring manual changes to your theme or CSS.
Here’s what NitroPack can do for you with just a click of a button:
All of this is handled automatically.
No manual subsetting, no editing link tags, and no guesswork.
Not entirely — even though Google Fonts is well-optimized, any external resource can introduce some delay. But with proper optimization (like limiting weights, using font-display: swap, and preconnect), the impact can be minimized to almost nothing.
System fonts offer the best performance because they’re already installed on the user’s device, meaning no downloads. But they come at the cost of design flexibility and brand consistency.
Yes, often. A single variable font file can replace multiple static files (e.g., 400, 500, 700), reducing the number of requests. But they can be larger in file size if you don’t subset them carefully.
The browser uses the default, which often hides text until the font loads (FOIT). This can delay content visibility and hurt perceived performance.
No — Google Fonts are open source and free to use and self-host. Just make sure you’re actually pulling them from fonts.google.com and not a third-party source with different terms.
Mostly rendering-related metrics:
Niko has 5+ years of experience turning those “it’s too technical for me” topics into “I can’t believe I get it” content pieces. He specializes in dissecting nuanced topics like Core Web Vitals, web performance metrics, and site speed optimization techniques. When he’s taking a breather from researching his next content piece, you’ll find him deep into the latest performance news.