Speed & performance · Guide
How to Preload Fonts in WordPress (2026)
Short answer
To preload fonts in WordPress, add a link rel=preload tag in the head of your site for each font file used above the fold, with as=font, type=font/woff2, and crossorigin. You can add the tag with code in a child theme, or switch on WP Rocket Preload fonts in the Media tab, or add the file URL in Perfmatters under Preloading. Preload only one to three WOFF2 files, then check the page source and the Network tab to confirm each one loads early.
Key takeaways
- Fonts load late because the browser only finds them after downloading and parsing the stylesheet.
- A font preload needs as=font, type=font/woff2, and crossorigin, or the browser downloads the file twice.
- Preload only the one to three WOFF2 files that style text on the first screen of the page.
- WP Rocket Preload fonts, in the Media tab, detects above-the-fold fonts and adds the tags itself.
- WordPress wp_resource_hints supports preconnect, not preload, so code preloads belong in wp_head.
- Chrome warns in the Console about unused preloads around 3 seconds after the load event.
What does it mean to preload fonts in WordPress?
Preloading a font tells the browser to download that font file early, before it finds the font in your stylesheet.
A normal page load finds fonts late. The browser reads the HTML, downloads the stylesheet, and only then sees the @font-face rule. web.dev explains that fonts in @font-face rules are not discovered until the browser downloads and parses those CSS files.
A preload link sits in the head section of the page. It names the exact font file, so the browser starts the download at once, in parallel with the stylesheet.
Preloading does not change how the font looks. It changes when the file arrives, and that timing shift cuts the wait before styled text appears.
Why do fonts load late without a preload?
Fonts load late because the browser cannot see them until it has worked through the HTML and CSS first.
web.dev notes that the browser does not download a web font until it has decided that the current page layout needs it. That decision comes after the stylesheet is parsed.
This late discovery puts fonts at the end of a chain: HTML, then CSS, then font. While the chain runs, text either stays invisible or shows in a fallback font.
Preloading breaks the chain. It moves the font request to the start of the page load, next to the stylesheet request.
Which fonts should you preload?
Preload only the fonts that style text on the first screen of the page.
The first screen is what a visitor sees before scrolling. Fonts used only in the footer, in popups, or below the fold do not need a preload.
Preload one weight and one style per family where you can. A regular 400 weight file covers most body text, and a bold 700 weight covers most headings. Keep the list to one to three files in most cases.
Use the WOFF2 format for every preload. web.dev states that WOFF2 has the best compression, up to 30% better than WOFF, and is often the only format needed for modern browsers as of November 2026.
How do you find the font files to preload?
Find the exact font file URLs in your browser before you add any preload.
- Open your home page in Chrome and press F12 to open DevTools.
- Click the Network tab, then reload the page.
- Type
fontin the filter box to show only font requests. - Look at the Name column for files ending in
.woff2. - Note the full URL, weight, and style of each file used above the fold.
PageSpeed Insights gives you a second source. The Preload key requests audit from Chrome for Developers flags resources on the third level of the critical request chain.
What does the preload link tag look like?
A font preload is one link tag in the head section, with five parts that each do a job.
Put the tag in the head of the page, before the stylesheet link. It carries five parts: rel set to preload, href set to the font file path, as set to font, type set to font/woff2, and the crossorigin attribute.
| Attribute | What it does | Example value |
|---|---|---|
rel="preload" | Tells the browser to fetch the file early | preload |
href | Points to the exact font file | /fonts/inter-400.woff2 |
as="font" | Sets the resource type so the browser can prioritise it | font |
type="font/woff2" | States the file format so unsupported types are skipped | font/woff2 |
crossorigin | Fetches the font with a CORS request, as fonts require | crossorigin |
The crossorigin attribute is the part most people miss. MDN Web Docs states that font preloading requires it, even when the fetch is not cross-origin. Without it, the browser downloads the file twice.
How do you preload fonts with WP Rocket?
WP Rocket can preload fonts for you with no manual list of file URLs.
- Open your WordPress dashboard and go to Settings, then WP Rocket.
- Click the Media tab.
- Find the Fonts section and turn on Preload fonts.
- Click Save Changes at the bottom of the page.
The feature works on its own after that. WP Rocket explains that it detects and preloads the fonts used in above-the-fold text. The process is not instant: a script detects the critical fonts on a visit, and WP Rocket adds the preload tags when the next page cache is generated.
A few limits apply, per WP Rocket. The feature only processes woff2, woff, and ttf files, and it will not preload system fonts such as Arial or Georgia.
For the full plugin setup, see how to configure WP Rocket for Core Web Vitals.
How do you preload fonts with Perfmatters?
Perfmatters lets you add each font preload by hand, with control over device and page.
- Open your WordPress dashboard and go to Settings, then Perfmatters.
- Click the Preloading menu.
- Under Preload, paste the full URL of the font file.
- Select Font as the resource type.
- Leave the priority at Auto unless the font is part of your largest visible text.
- Scroll down and click Save Changes.
- Clear your site cache, then reload the page and check the result.
Perfmatters states that the preload tag is added toward the top of the head section on every page of your site. You can narrow it with the location setting, for example by adding a post ID.
You can also set the device to desktop or mobile. Perfmatters notes that mobile preloads need separate mobile caching, which many cache plugins and hosts already provide.
How do you preload fonts with code?
Use code when you do not run a performance plugin.
You need a child theme or a code snippets plugin, plus a backup of your site. Never edit your parent theme files directly, since a theme update will wipe your change.
Add this snippet to your child theme functions.php file, or to a code snippet set to run on the front end:
add_action( 'wp_head', function() {
$tag = '<' . 'link rel="preload" href="/wp-content/themes/your-theme/fonts/inter-400.woff2" as="font" type="font/woff2" crossorigin>';
echo $tag;
}, 1 );
The two strings join into one link tag when the page loads.
Replace the href value with your own font file path. The priority of 1 prints the tag near the top of the head section. The code method takes about 15 to 30 minutes, while a plugin method takes about 10 minutes.
Note that the wp_resource_hints filter cannot do this job. WordPress Developer Resources lists it for dns-prefetch, preconnect, prefetch, and prerender only, since WordPress 4.6.0.
Use that filter for preconnect instead. This snippet opens connections to the two Google Fonts origins early:
add_filter( 'wp_resource_hints', function( $urls, $relation_type ) {
if ( 'preconnect' === $relation_type ) {
$urls[] = 'https://fonts.googleapis.com';
$urls[] = array(
'href' => 'https://fonts.gstatic.com',
'crossorigin' => 'anonymous',
);
}
return $urls;
}, 10, 2 );
How do you preload Google Fonts in WordPress?
Google Fonts needs two steps: a preconnect to its origins and, where possible, a preload of the font file itself.
Google Fonts serves its CSS from fonts.googleapis.com and its font files from fonts.gstatic.com. web.dev notes that some font providers serve CSS and font resources from different origins.
Add a preconnect for each origin early in the head section, with crossorigin on the fonts.gstatic.com line:
Add one preconnect line for fonts.googleapis.com and one for fonts.gstatic.com, with crossorigin on the second line.
Preconnect alone does not download any font file. To preload a Google font file, open the Google Fonts CSS URL in your browser, find the src: url(...) line for the weight you use, and copy that fonts.gstatic.com address.
Add display=swap to your Google Fonts request if it is missing. Google Fonts documents the CSS API v2 display parameter, which accepts auto, block, swap, fallback, and optional.
With swap, the browser shows text at once in a fallback font and swaps in the web font when it arrives. web.dev notes that Chromium and Firefox block text rendering for up to 3 seconds with the default block value, while Safari blocks indefinitely.
What mistakes make font preloads fail?
Most failed preloads come from small errors in the tag or the file choice.
- Missing
crossoriginon a font preload, which makes the browser fetch the file twice. - A
hrefthat does not match the real file URL, such as a missing query string. - Preloading every weight and style instead of the one or two used above the fold.
- Preloading fonts that only appear below the fold or in hidden elements.
- Preloading old formats such as TTF when a WOFF2 file is available.
- Adding the snippet to the parent theme, then losing it at the next theme update.
- Testing before clearing the cache, so the old page is what gets measured.
Too many preloads hurt as well. web.dev warns that if too many resources are prioritised, effectively none of them are. Keep the list short.
Font preloading also overlaps with other speed work. A slow stylesheet still delays text, so pair preloads with fixes for render-blocking resources.
How do you check that preloading worked?
Check the page source first, then the network log, then a fresh speed run.
- Open your home page, right-click, and choose View page source.
- Press Ctrl+F and search for
rel="preload". - Confirm each font file appears once, with
as="font"andcrossorigin. - Open DevTools with F12, click the Network tab, and reload the page.
- Filter by Font and check that each preloaded file starts early.
- Open the Console tab and look for unused preload warnings.
Chrome warns you about wasted preloads. web.dev states that unused preloads trigger a Console warning in Chrome, about 3 seconds after the load event. If you see that warning for a font, remove its preload tag.
Run PageSpeed Insights again after clearing the cache. Look at the Opportunities list and at Largest Contentful Paint, the metric most affected when a text block is the largest visible element. For the full pass, follow how to pass Core Web Vitals in WordPress.
If the preload is missing, clear every cache layer: plugin, server, and CDN. Then reload as a logged-out visitor.
How does preloading affect Core Web Vitals?
Font preloading mainly helps Largest Contentful Paint and Cumulative Layout Shift.
Largest Contentful Paint measures when the largest visible element appears. When that element is a block of text, the font file sits on the path to it. web.dev explains that large runs of text rendered with web fonts can benefit a lot from a well-placed preload hint.
The optional value has a strict cutoff. web.dev states that optional only uses the web font if it downloads within 100 milliseconds.
Frequently asked questions
Should I preload every font on my site?
No. Preload only the fonts that style text on the first screen, usually one to three WOFF2 files. Every extra preload competes for bandwidth at the start of the load, and fonts used below the fold or in hidden elements gain nothing from an early download. Keep the list short and re-check it after any theme or font change.
Why does my font preload need crossorigin?
Fonts are always fetched with anonymous CORS, even from your own domain. The preload tag must match that mode, so the crossorigin attribute is required. Without it the preloaded file does not match the later font request, and the browser downloads the file twice, which costs bandwidth and gains nothing.
Can I preload Google Fonts?
Yes, but it takes two steps. First add preconnect tags for fonts.googleapis.com and fonts.gstatic.com, since Google serves its CSS and its font files from different origins. Then copy the exact WOFF2 address from the Google Fonts CSS response and preload that file with as=font and crossorigin. Adding display=swap to the request also keeps text visible while the font loads.
Does preloading fonts help Core Web Vitals?
It can help Largest Contentful Paint when a block of text is the largest visible element, since the font arrives sooner. It also pairs with font-display values such as block, fallback, and optional to limit layout shift. It will not fix a slow server or a heavy page on its own.
How long does it take to preload fonts in WordPress?
A plugin method takes about 10 minutes: turn on WP Rocket Preload fonts or add the file URL in Perfmatters. The code method takes about 15 to 30 minutes, including finding the exact font file URLs in DevTools and adding the snippet to a child theme. Allow extra time for WP Rocket, since its detection runs asynchronously over later visits.
Sources
- Preload critical assets to improve loading speed web.dev
- Optimize web fonts web.dev
- rel=preload HTML attribute value MDN Web Docs
- Preload fonts WP Rocket Knowledge Base
- How to preload a resource in WordPress Perfmatters
- wp_resource_hints() WordPress Developer Resources
- CSS API update Google for Developers
- Preload key requests Chrome for Developers
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
