How to install Google Fonts in compliance with GDPR

Utilize Google Fonts to enhance your website’s appearance with a wide selection of fonts hosted on Google’s servers. To ensure GDPR compliance and prevent data transmission without explicit consent, it’s crucial to install Google Fonts in a privacy-friendly way. Let’s see how to achieve this using My Agile Privacy.

If you use a page builder that automatically includes Google Fonts, you’ll find guidance at the end of this article on how to embed and serve fonts locally for GDPR compliance.

Solution 1 – Automatic Scan

You can use the advanced "Cookie Shield" feature, which can automatically detect Google Fonts.
Simply set the Shield to "Learning" mode and browse your site’s pages—the plugin will scan and prepare your configuration automatically.
However, for optimal graphic rendering and better control, manual configuration is recommended for Google Fonts.

Solution 2 – Manual Configuration

Part 1 – Identifying the Google Fonts Code

First, locate the code for the Google Fonts you wish to use.
Depending on your selection, the embed code will look like this:

Part 2 – Adding the Google Fonts Cookie in My Agile Privacy

In your WordPress admin, go to My Agile Privacy → Cookie List from the left menu.
You’ll see a list of cookies imported during plugin installation, all initially set to draft.
Publish only the cookies relevant to your website.

On this screen, you will see several columns:

  • Cookie Name: the name of the cookie.
  • Is Necessary: indicates if the cookie is essential for your site’s operation. If the site breaks without it, it will be marked as essential (this is pre-filled for you).
  • Auto Update: determines if the reference text for the cookie is kept automatically up-to-date for GDPR compliance. If set to "yes," the plugin manages updates.
  • Installation Type: the method used for including the cookie. This varies according to your setup and is detailed in the guides.

To add Google Fonts, search for "Google Fonts (Google Inc.)" in the list and click on it.
The detail page includes pre-filled informational text and two blank fields for code input. This pre-filled text appears in your cookie policy and remains up-to-date if "Allow Automatic Update" is enabled.
Below, select "Installation Type" (Javascript and Noscript, or Raw). Select "Raw Code" to reveal the "raw html code" field.

Part 3 – Adding the Google Fonts Embed Code

Paste the Google Fonts embed code directly into the "Html Raw Code" field.

Remember to save and publish the cookie by clicking the blue "Publish" button in the upper right corner.

Final Step – Verifying Operation

Now, verify that Google Fonts loads properly on your website.
You’ll notice that your chosen fonts are not loaded (the browser’s default font will be used instead) until explicit consent to use Google Fonts is given—either by clicking "I agree" on the cookie consent bar, or by going to "Customize" and activating the corresponding cookie.

Bonus – What if You Use a Page Builder or Plugin That Incorporates Google Fonts?

Many page builders, such as Elementor and Visual Composer, and dedicated plugins, can automatically embed Google Fonts while offering rich font customization. However, this often does not guarantee GDPR compliance.
To address this issue, consider using the Embed Google Fonts plugin.
This plug-and-play solution allows you to automatically download your selected Google Fonts and host them locally on your server.
You simply identify the fonts used by your themes or plugins, download them to your website, and update your setup to use these locally hosted files instead of fetching them from Google’s servers.
With this approach, your website remains GDPR compliant without sacrificing flexible font customization options.

Download the free guide

Fill out the form and get immediate access to the guide in PDF format.
Mockup del pdf della guida
Loading in Progress...
Request successfully sent. You will be redirected to the download page shortly
By submitting this form I declare that I have read the privacy policy and authorize the Owner to respond to me for what is expressed in point a of the privacy policy
Warning: Your Cookie choices may not allow the form to be submitted.
Click here to review your preferences.
buy now My Agile Privacy - compliant in less than 3 minutes
a Formula Agile SRL project
COE / TAX ID 31366
Via Tre Settembre, 99 - 47891 Dogana - San Marino - RSM
Share capital 26'000€
For assistance: info[at]myagileprivacy.com
GDPR and privacy present complexities that extend beyond achieving website compliance. Compliance obligations span across all business aspects and necessitate expert analysis.
When it comes to implementing Banners and Policies, trust My Agile Privacy—the only solution that excludes unnecessary implementations not mandated by regulations.
Logo CMP partner GoogleLogo CMP partner GoogleLogo CMP partner GoogleLogo IAB Europe approvedLogo IAB Europe approved