Speed & performance · Guide
How to Host Google Fonts Locally in WordPress
Short answer
To host Google Fonts locally, download the WOFF2 files for the fonts your site uses and serve them from your own server with @font-face rules in your theme CSS. The OMGF plugin can find and download the fonts for you, and Perfmatters has a Local Google Fonts toggle that does the same. After the change, check the Network panel in DevTools to confirm no requests go to Google's font servers.
Key takeaways
- Local hosting means the font files live on your server, so no visitor request goes to Google for fonts.
- Google Fonts are free and open source, and the most common licence is the SIL Open Font License.
- OMGF is free, has 300,000+ active installs, and downloads your Google Fonts to your server automatically.
- Perfmatters stores local fonts under its cache folder and creates a stylesheet your pages link to.
- Use font-display: swap for body text so visitors can read at once while the font loads.
- WOFF2 gives up to 30% better compression than WOFF, according to web.dev.
What does hosting Google Fonts locally mean?
Hosting Google Fonts locally means storing the font files on your own server and loading them from your domain instead of Google's servers.
With the usual setup, your theme or a plugin adds a link to Google's stylesheet, and each visitor's browser then fetches the font files from Google. When you host locally, that link is gone.
A local font is a WOFF2 file in a folder on your site, such as /wp-content/uploads/fonts/, that your CSS points to with an @font-face rule, as Google Fonts Knowledge shows in its guide to using web fonts.
Why host Google Fonts locally instead of using Google's servers?
Hosting locally removes the extra connection to Google, so your pages make fewer third-party requests and you control how the fonts load.
Perfmatters lists the gains in its local Google Fonts guide: no third-party DNS lookups, faster First Contentful Paint, and more control over preloading and font-display.
It also notes that Chrome moved to HTTP cache partitioning in October 2020, so Google Fonts are now redownloaded for every site.
web.dev states that in most cases self-hosting web fonts is faster than downloading them from a cross-origin, and that sites should use a CDN, HTTP/2 or HTTP/3, and correct caching headers, in its guide to optimizing web fonts.
There is a privacy angle too. The OMGF page on WordPress.org states that German courts have ruled that loading Google Fonts directly violates GDPR, since visitor IP addresses get logged by Google, as its plugin page explains.
If that point matters to your site, read our guide to GDPR compliance for WordPress before you decide.
What do you need before you start?
You need WordPress admin access, a backup of your site, and a list of the fonts and weights your site actually uses.
Open your site and note each font family and the weights in use, such as 400 for body text and 700 for headings. Google's CSS API docs note that the default weight is 400 for regular text, in the CSS API update.
Pick your route before you touch anything: a plugin, or the manual method below. Allow 15 to 30 minutes for the plugin method, and about an hour for a first manual setup.
For the manual method, use a child theme. The WordPress Theme Handbook says parent updates will not wipe child theme changes, as its child themes guide explains.
How do you host Google Fonts locally with OMGF?
You host Google Fonts locally with OMGF by installing the plugin, opening its settings, and letting it find and download the fonts your site uses.
OMGF is a free plugin with 300,000+ active installs, according to its WordPress.org page. Version 6.4.1 was the latest release listed there, as of November 2026, and the page was updated on 2 November 2026.
Follow these steps:
- In WordPress, go to “Plugins > Add Plugin” and search for “OMGF”.
- Click “Install Now”, then “Activate”.
- Go to “Settings > Optimize Google Fonts”.
- Visit your home page and a few other pages while logged out, so OMGF can find every font your site loads.
- Open the “Optimize Local Fonts” section and check the fonts it found.
- Preload the fonts used above the fold, and unload any families or weights you do not use.
- Save the settings and clear your page cache.
OMGF works at once with no setup required, as its WordPress.org page states. It scans for Google Fonts, Bunny Fonts, and the Jetpack CDN, then downloads them to your server on its own.
Its Performance Checker flags unused subsets, unused weights, and missing preloads. Its Google Fonts checker warns you when a theme or plugin update adds new Google Fonts.
How do you host Google Fonts locally with Perfmatters?
You host Google Fonts locally with Perfmatters by turning on its “Local Google Fonts” option, which downloads the fonts to your server for you.
Perfmatters is a paid performance plugin, so this route fits sites that already use it.
Follow these steps:
- In WordPress, open the Perfmatters plugin settings.
- Click the “Fonts” menu.
- Toggle on “Local Google Fonts”.
- Toggle on “Display Swap” to show fallback text while fonts load.
- Limit the subsets to the languages your site uses.
- Scroll down and click “Save Changes”.
- Visit a page on your site, since the fonts download on the first visit after you turn it on.
Perfmatters saves the fonts to /wp-content/cache/perfmatters/yourdomain.com/fonts/ and creates a stylesheet in the same folder that your pages link to, according to its docs.
To start over, go back to the “Fonts” menu and click “Clear Local Fonts”, which also clears the stylesheet. Note one limit from the same docs: fonts added with @import are not picked up, so check your theme for those first.
How do you host Google Fonts locally by hand?
You host Google Fonts locally by hand by downloading the WOFF2 files, uploading them to your server, and pointing your CSS at them with @font-face.
First, confirm the licence allows it. Google's FAQ states that all Google Fonts are open source and without cost, and that the most common licence is the SIL Open Font License, as its FAQ page explains.
Follow these steps:
- Open your font on fonts.google.com and note the exact family name and the weights you need.
- Open the CSS API address for that font, such as
https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap. - Copy the WOFF2 file addresses from the CSS that Google returns, and save each file.
- Upload the files to a
fontsfolder inside your child theme, such as/wp-content/themes/your-child-theme/fonts/. - Add one
@font-facerule per file to your child theme'sstyle.css, with the matching weight and style. - Make sure the child theme stylesheet loads, using
wp_enqueue_style()infunctions.phpif your parent theme does not load it. - Remove the old Google Fonts link from your theme or plugin settings, then clear your cache.
Google's CSS API docs show that the v2 API uses the base address https://fonts.googleapis.com/css2 and that you request weights with wght@400;700, as the CSS API update explains.
A variable font can cover weights from 100 to 900 in one file, so use one if your font offers it and you need several weights.
Add rules like this for each file:
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('fonts/inter-400.woff2') format('woff2');
}
Repeat the block for each weight, changing only font-weight and the file name.
Keep the list short. Google's CSS API docs warn that requesting styles you do not use makes visitors download more font data than they need. See our guide to removing unused CSS in WordPress for the same habit with stylesheets.
Which font-display value should you use, and should you preload fonts?
Use font-display: swap for body text, since it shows fallback text at once and swaps in your font when it arrives.
font-display is a descriptor inside @font-face that sets what the browser shows while a font loads. MDN lists 5 values, with swap giving an extremely small block period and an infinite swap period, in its font-display reference.
The initial value is auto, so always set a value yourself.
| Value | Block period | Swap period | Best for |
|---|---|---|---|
auto | Browser decides | Browser decides | Avoid |
block | Short, up to 3 seconds | Unlimited | Icon fonts |
swap | Extremely small | Unlimited | Body text |
fallback | Extremely small | Short | Slow networks |
optional | Extremely small | None | No-shift cases |
web.dev says Chromium and Firefox block text for up to 3 seconds before using a fallback, while Safari blocks until the font loads. The same guide says optional only uses the font if it downloads within 100 milliseconds.
Preload only the one font your first screen needs. web.dev says the crossorigin attribute is required for fonts, even self-hosted ones, since fonts are treated as CORS resources.
Add a preload line for that one file. Set rel to preload, as to font, href to the font file path, and add the crossorigin attribute.
Preloading every weight wastes bandwidth and can slow the first paint. For help with the metric this affects, see our guide to improving Largest Contentful Paint in WordPress.
How do you check that your fonts are hosted locally?
You check by opening your site in Chrome DevTools and confirming that no request goes to Google's font domains.
Open DevTools with F12, click the “Network” tab, and reload the page. Chrome's DevTools docs say the Network panel records requests while DevTools is open, and its Filter box accepts a domain: property, as the Network features reference explains.
Type domain:fonts.googleapis.com in the Filter box. A clean result shows no requests. Then clear the filter, click the “Font” type button, and check that each WOFF2 file lists your own domain.
Also check the page still looks right. Load the home page and a post, and confirm the fonts match your design.
Perfmatters notes that local hosting resolves the “Reduce the impact of third-party code” warning. For a wider speed check, see our guide to passing Core Web Vitals in WordPress.
What mistakes should you avoid?
Avoid these 6 mistakes, since each one can undo the work or leave your text looking wrong.
Loading every weight and subset. Only load the families, weights, and subsets your pages use. Google's CSS API docs note that the text= parameter can cut a font file by up to 90% for a logo or heading.
Forgetting font-display. Without swap or fallback, text can sit invisible while the font loads. Set font-display in every @font-face rule, including bold and italic faces.
Preloading every font file. Preload only the font used above the fold. Without crossorigin, the browser may fetch the file twice, so keep that attribute on every font preload.
Editing the parent theme directly. Put your @font-face rules and font files in a child theme. The Theme Handbook says parent theme updates will not remove child theme changes, so your fonts survive the next update.
Leaving the old Google Fonts link in place. A theme, plugin, or page builder can still load Google Fonts after you self-host. Search your page source for fonts.googleapis.com and remove each link you find.
Skipping the cache clear. Clear your page cache and your CDN cache after the change, or visitors may keep getting the old pages.
If text still loads from Google after these checks, look for a second source, such as a page builder. Elementor 3.30 and later hosts its Google Fonts locally on its own, according to the Perfmatters docs.
Frequently asked questions
Is it legal to host Google Fonts locally?
Yes, Google Fonts are open source and free to use, and the most common licence is the SIL Open Font License, which allows redistribution under its terms. Check the licence file for your font before you use it, since a few fonts use the Apache or Ubuntu Font Licence instead.
Will hosting Google Fonts locally make my site faster?
It can help, since it removes third-party DNS lookups and requests to Google, and web.dev notes that self-hosting is usually faster than a cross-origin download. The gain is largest when you also load only the weights you use and set font-display to swap.
Do I need to keep the Google Fonts link in my theme after self-hosting?
No, remove it. If the old link stays in place, browsers keep fetching fonts from Google and your local files go unused. Search your page source for the Google Fonts address and remove each link you find, then clear your cache.
What happens if I change my theme after hosting fonts locally?
Fonts stored in a child theme stay in place when the parent theme updates, but they do not move with you if you switch themes. Plugins such as OMGF and Perfmatters re-scan the new theme and download its fonts again, so check their settings after a switch.
Can I host Google Fonts locally without a plugin?
Yes. Download the WOFF2 files, upload them to a folder in your child theme, and add an @font-face rule for each file with font-display set to swap. Remove the old Google Fonts link, clear your cache, and check the Network panel to confirm the fonts load from your domain.
Sources
- CSS API update Google for Developers
- Frequently Asked Questions Google for Developers
- Using web fonts Google Fonts
- Optimize web fonts web.dev
- font-display CSS at-rule descriptor MDN Web Docs
- OMGF | GDPR/DSGVO Compliant, Faster Google Fonts. Easy. WordPress.org
- How to host Google Fonts locally in WordPress Perfmatters
- Network features reference 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.
