Cookies & tracking
Google Fonts and GDPR: why to self-host, and how
Loading Google Fonts from Google's servers sends every visitor's IP address to Google before they can consent. A German court found that unlawful in 2022, and the simple fix is to host the font files on your own server.
- Plain English
- Written for website owners
- Free to read
On this page
When your pages load fonts from fonts.googleapis.com, every visitor's browser contacts Google before your cookie banner can ask anything. That request sends the visitor's IP address to Google. In January 2022, the Regional Court of Munich held that doing this without consent or another valid legal basis violated the GDPR, and ordered the site operator to pay damages. You can avoid the issue entirely by hosting the font files on your own server, which is free and usually takes less than an hour.
What happens when you embed Google Fonts
The standard embed code from the Google Fonts website looks like this:
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
When a visitor opens your page, the browser makes two kinds of request:
- It fetches a stylesheet from
fonts.googleapis.com, which contains@font-facerules tailored to the browser. - It downloads the font files that the stylesheet points to from
fonts.gstatic.com.
Both requests reach Google's servers with the visitor's IP address, user agent and, depending on your referrer policy, the page URL. Google states that the Fonts API doesn't set cookies and that requests aren't tied to Google accounts. That's why this isn't mainly an ePrivacy cookie problem. It's a GDPR question: you are disclosing personal data, the IP address, to a third party, and you need a legal basis under Article 6.
The Munich ruling and what it decided
On 20 January 2022, the Regional Court of Munich I (Landgericht München I, case 3 O 17493/20) ruled on a claim by a visitor whose IP address had been passed to Google when he visited a website that embedded Google Fonts. The court's main points were:
- A dynamic IP address is personal data for the website operator, because there are legal means to identify the person behind it.
- The operator had no legal basis. The visitor hadn't consented, and legitimate interest under GDPR Art. 6(1)(f) didn't apply because the fonts could be used without contacting Google, by self-hosting them.
- The visitor was entitled to relief. The court ordered the operator to stop passing IP addresses to Google this way and awarded €100 in damages for the loss of control over personal data.
The ruling is from a single regional court and doesn't bind other courts. Its reasoning was widely noticed, though, and the "self-hosting is possible, so legitimate interest fails" argument applies to many other third-party resources too.
The decision also prompted a wave of mass demand letters in Germany in 2022, sent to website owners who still used Google-hosted fonts. Many of these were themselves challenged as abusive, and authorities investigated some of the senders. The episode is a reminder that low-value claims can become expensive when multiplied, even when each claim is questionable.
Later case law has refined the damages question. In May 2023, the Court of Justice of the EU held in Österreichische Post (C-300/21) that a GDPR infringement alone doesn't automatically give a right to compensation, but that there's no minimum seriousness threshold for non-material damage either. Claimants still have to show they suffered damage.
Does the EU-US Data Privacy Framework fix it?
Partly. Google LLC participates in the EU-US Data Privacy Framework, which the European Commission found adequate in July 2023. That addresses the international transfer question under GDPR Chapter V. It doesn't address the earlier question of whether you have a legal basis to disclose the IP address to Google in the first place, which was the core of the Munich decision.
The Framework has also faced legal challenge. As of late 2026, an appeal against the General Court's September 2025 judgment upholding it is pending before the Court of Justice. Relying on it for a font file you could simply host yourself is unnecessary.
Self-hosting removes the legal question instead of answering it. If the font comes from your own server, no visitor data reaches Google, so you need no consent, no legitimate interest assessment and no transfer analysis for it.
How to self-host Google Fonts, step by step
1. Find out which fonts and weights you use
Search your theme and CSS for fonts.googleapis.com and note each family and weight. Then open a page in a private window, open DevTools, go to the Network tab and filter by fonts.g. Every request listed there is a Google-hosted font file.
2. Download the font files
You have several options:
- Google Fonts website. Each family has a download option that gives you the font files and license.
- Fontsource. An open-source project that packages Google Fonts for npm, for example
npm install @fontsource-variable/inter. It suits sites with a JavaScript build step. - Community download helpers. Tools such as google-webfonts-helper generate ready-to-use WOFF2 files and CSS for the subsets and weights you choose.
Use WOFF2, which every current browser supports and which compresses well. If a family offers a variable font, a single file can cover all the weights you need.
3. Upload the files and add @font-face rules
Put the files in a folder on your site, such as /fonts/, and declare them in your CSS:
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 100 900; /* range for a variable font */
font-display: swap;
src: url('/fonts/inter-latin-variable.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
body {
font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
If you only need a Latin subset, the unicode-range line can be left out. Keep it if you serve several subsets, so the browser downloads only the file it needs.
4. Preload the most important file
For the font used above the fold, a preload hint helps the browser fetch it early:
<link rel="preload" href="/fonts/inter-latin-variable.woff2" as="font" type="font/woff2" crossorigin>
The crossorigin attribute is required for font preloads even on your own domain, or the browser will download the file twice.
5. Remove every reference to Google's servers
Delete the old <link> tags, the preconnect hints and any @import url('https://fonts.googleapis.com/...') lines in your CSS. Then reload in a private window with the Network tab open and confirm nothing goes to fonts.googleapis.com or fonts.gstatic.com.
Where Google Fonts hide
Removing your theme's font link is often not enough. Fonts from Google can also arrive through:
- WordPress themes and page builders, many of which load Google Fonts by default. Several have a setting to load fonts locally. Plugins also exist that download and rewrite Google Fonts automatically.
- Plugins such as sliders, form builders and icon sets that add their own font links.
- Embedded Google services, such as Maps and reCAPTCHA, which load fonts and other resources from Google as part of the embed. Those need to be handled as embeds, behind consent or click-to-load. The YouTube embeds guide shows the click-to-load pattern.
- Email templates and landing page tools hosted on other platforms, which you may need to configure separately.
A crawl is more reliable than checking pages by hand. A free PrivacyQuick scan lists the third-party hosts each page contacts, so any remaining fonts.gstatic.com requests show up. The website cookie audit guide explains how to record these findings.
Performance after self-hosting
A common objection is that Google's CDN is faster because visitors already have the fonts cached. That stopped being true when browsers partitioned their HTTP caches by site. Chrome did so in 2020, and Safari and Firefox partition caches as well. A font cached while visiting one site isn't reused on another, so every site downloads its own copy anyway.
Self-hosting removes the extra DNS lookup and connection to Google's domains, and lets you control caching headers. Set a long Cache-Control lifetime on font files and use versioned file names when you change them. The page speed guide covers other ways third-party resources affect Core Web Vitals.
The same logic applies to other CDNs
Google Fonts became the test case, but the Munich court's reasoning applies to any third-party resource that sends visitor IP addresses to another company when you could reasonably host it yourself. Review JavaScript libraries loaded from public CDNs, icon fonts and font services such as Adobe Fonts. Some providers market themselves as privacy-friendly alternatives to Google's font CDN. Read their terms and logging policy before you rely on them, or just self-host.
Fonts are one item on a longer list. Contact forms, newsletter tools and analytics also involve third parties, and the GDPR guide for small business websites walks through them.
Checklist
- List every font family and weight your site uses.
- Download WOFF2 files and serve them from your own domain with
@font-face. - Remove Google font links, preconnects and CSS imports from your theme, plugins and templates.
- Switch page builders and themes to local font loading where they offer it.
- Put Google Maps, reCAPTCHA and video embeds behind consent or click-to-load.
- Verify in a private window that no request goes to
fonts.googleapis.comorfonts.gstatic.com.
Frequently asked questions
Does Google Fonts set cookies?
Google states that the Google Fonts API doesn't set cookies. The GDPR issue is the request itself, which sends the visitor's IP address and browser details to Google.
Can I ask for consent before loading Google Fonts instead of self-hosting?
You could, but it works badly in practice. Fonts are needed before the visitor has made a choice, so the page would render in a fallback font for everyone who hasn't accepted. Self-hosting avoids the problem.
Is it legal to self-host Google Fonts?
Yes, for the fonts in the Google Fonts library, which are released under open licenses such as the SIL Open Font License. Check the license file that comes with each family if you plan to modify or redistribute it.
Does self-hosting fonts make my site slower?
Usually not. Browsers no longer share cached fonts between different websites, so the old speed argument for Google's CDN has largely disappeared, and serving fonts from your own domain avoids an extra connection.
Check your own website in 30 seconds
Our free scanner lists every cookie and tracker your site sets, sorted into categories, before you add a banner.
This guide is general information, not legal advice. Laws and regulator guidance change; check the current rules for your situation or ask a lawyer.