Google Fonts made good typography free and easy, and most WordPress themes load at least one font from fonts.googleapis.com. It looks harmless. It has two costs most site owners do not see: privacy and speed.
The privacy problem
When a visitor’s browser loads a font from Google’s servers, it sends their IP address to Google, along with the page they are on. Under the GDPR, an IP address is personal data, and sending it to another company needs a legal basis.
In January 2022 a court in Munich ruled that a website owner had broken the GDPR by loading Google Fonts from Google’s servers without consent, and awarded the visitor damages of 100 euros. The amount was small, but it was followed by waves of warning letters sent to thousands of site owners in Germany and Austria, each asking for a payment.
Whatever you think of those letters, the simplest way to avoid the question is to stop sending the data at all: serve the font files from your own site.
The speed problem
Loading a font from Google takes two extra steps before any text can use it:
- a connection to
fonts.googleapis.comto get the stylesheet; - a second connection to
fonts.gstatic.comto get the font files.
Each new connection costs a DNS lookup, a TCP connection and an HTTPS handshake: often 100 to 300 milliseconds on a phone. Browsers no longer share cached fonts between sites, so every visitor pays this cost on their first visit to your site, even if they saw the same font elsewhere a minute ago.
Served from your own domain, the fonts come over the connection the browser already has open.
How to host fonts yourself
The manual way
- Download the font files (WOFF2 format is all modern browsers need).
- Upload them to your theme or uploads folder.
- Write
@font-facerules in your CSS that point to them. - Remove the line that loads the Google stylesheet, which may be in the theme, a page builder or a plugin.
This works, but step 4 is where it gets fiddly: page builders and plugins often add their own Google Fonts links, and updates can bring them back.
The automatic way with Keel Pro
In Keel › Speed › Fonts & connections, switch on Host Google Fonts on this site. The first time a page with Google Fonts is visited, Keel makes a local copy of the stylesheet and font files in the background. From then on, pages load the fonts from your own address, whichever theme or plugin asked for them. No visitor data goes to Google.
Check the result
- Open a page in a private window, press F12 and open the Network tab.
- Reload and type “fonts.g” in the filter box.
- No requests should go to
fonts.googleapis.comorfonts.gstatic.com.
While you are at it
- Use fewer font files. Every weight and style is a separate file. Regular, bold and perhaps one other is usually enough.
- Use
font-display: swap, so text shows in a fallback font while the custom font loads, instead of staying invisible. - Consider system fonts for body text. They load instantly and look native on every device.
Common questions
Is the font licence a problem if I host the files myself?
No. Google Fonts are released under open licences, mostly the SIL Open Font License, which allows self-hosting.
Do I need a cookie banner for Google Fonts?
Google Fonts set no cookies. The legal question is the transfer of the IP address, which disappears when the fonts come from your own site.
Will the fonts look different?
No. They are the same files, served from another address.