How to Host Google Fonts Locally in WordPress (GDPR)
When your site loads a font from fonts.googleapis.com, every visitor’s browser connects to Google and sends it their IP address. In the EU that has been a real legal risk since a German court (Landgericht München, January 2022) ruled that embedding Google Fonts this way, without consent, breaks the GDPR. The fix is simple: host the font files on your own server. It’s often faster too, because the browser doesn’t need to open a connection to another domain.
This guide covers three ways to do it, and how to check that no request goes to Google any more.
Step 1: find out where Google Fonts come from
Before changing anything, see what your site loads today. Open your site in Chrome, press F12, go to the Network tab, reload the page and type fonts in the filter. Any request to fonts.googleapis.com or fonts.gstatic.com is a font loaded from Google.
Common sources:
- the theme (many themes enqueue Google Fonts by default),
- the page builder (Elementor, for example, loads Google Fonts for its typography settings),
- plugins such as sliders or form builders.
Note which fonts and weights appear. You’ll need the same ones locally.
Option 1: by hand
- Download the font files. google-webfonts-helper lets you pick a font, the weights and the character sets, and gives you
.woff2files plus ready-made CSS. - Upload the files to your child theme, for example
wp-content/themes/your-child-theme/fonts/. - Add the
@font-facerules to your stylesheet:
@font-face {
font-family: "Inter";
src: url("fonts/inter-v13-latin-regular.woff2") format("woff2");
font-weight: 400;
font-style: normal;
font-display: swap;
}
- Stop the original Google request. If your theme enqueues it, dequeue the stylesheet by its handle (you can find the handle in the
idof the<link>tag in the page source, without the-cssending):
add_action( 'wp_enqueue_scripts', function () {
wp_dequeue_style( 'theme-google-fonts' ); // replace with the real handle
}, 100 );
This works, but you repeat it for every font and weight, and a theme or builder update can bring the Google request back.
Option 2: block themes (WordPress 6.5+)
Since WordPress 6.5, the Font Library in the Site Editor can install Google Fonts. Go to Appearance → Editor → Styles → Typography, manage fonts and install from Google Fonts. WordPress downloads the files to your server and serves them locally. This covers fonts used by the block theme, but not fonts loaded by plugins or page builders.
Option 3: with Font Hero
Font Hero imports Google Fonts, stores them on your server and manages how they load, for any theme or builder.
- Go to Font Hero → Fonts → Add Font → Google Font.
- Search for the font and open its import options.
- Pick only the variants you use (most sites need 2–3, for example 400, 400 italic and 700).
- Pick only the subsets you need. An English site only needs Latin. A full font file can be around 80 KB, while the Latin subset can be as small as 15–20 KB.
- Choose the font display setting and click Import.
Font Hero downloads the files to /wp-content/uploads/font-hero/google-fonts/. Then go to Font Hero → Settings and turn on Disable Google Fonts, so the theme or plugins can’t keep requesting fonts from Google. If you use Elementor, also turn on Disable Elementor Google Fonts.
Step 2: check that it worked
Clear your caches, open the site in a private window and repeat the Network check. Filter by fonts.g: there should be no requests to fonts.googleapis.com or fonts.gstatic.com. Your fonts should now load from your own domain.
Only import the weights and character sets you actually use. Every extra variant is another file the browser has to download.
