Self-host all fonts for GDPR compliance - how to override system/google fonts

A client needs to have font files hosted locally on their site due to European GDPR concerns. (There was a lawsuit against a site in Europe that was referencing fonts on google, and the website user had not given permission for his IP address to be passed to Google.)

It seems from reading documentation that the SYSTEM fonts are all Google fonts. Ick.

If we locate and download the font files, we could presumably UPLOAD them as custom fonts.

But, for example, how do we override Google/system “JoeFont” with self-hosted “JoeFont”?

Is there a way/place to set this so self-hosted fonts of the same name are referenced first?

This is quite a serious issue for European sites, and it has broad ramifications, so some detailed instructions or help would be greatly appreciated.

We had a user want to use bunny fonts instead of google fonts and here is the filter below. You could implement something similar to bunny locally. You would just need have the same pathing as google fonts. At some point we plan on having controls for the google fonts url to change without a filter.

add_filter('cs_google_fonts_uri', function() {
  // Or '/wp-uploads/your-font-folder'
  return '//fonts.bunny.net/css';
});

Thanks for that!

Where exactly would I place that code so that it overrides for the whole site? We can presumably locate and then download all of the Google fonts we need and place them wherever we reference. We just don’t want to have to touch each template individually…

NOTE: It looks like under the Child theme this can go under functions.php. I’m trying it for now unless you have a better place to put it for permanent override.

1 Like

Yes, Child theme is a great spot to put it. Let us know if you have any other questions!

Hey @caldwell, Bunny Fonts is GDPR compliant so the filter provided by Charlie should be all you need to switch away from Google. No need to fuss around with downloading fonts locally or anything.

From the Bunny site:

GDPR compliance without the hassle

Retake control of your user’s privacy. With a Zero Logging policy and strictly European-based systems, Bunny Fonts keeps your user’s PII data their own and helps you simplify development and achieve GDPR compliance.

1 Like

is there a way to integrate that somehow in the theme?
it would also be great to host the fonts locally via the theme? like an checkbox : store font local…
or something like that.

thanks in advance

1 Like

Hey @deranaloge,

I’ll add your concerns as feature request so that it will be taken into action in the future.

Thank you.

I used this plugin and it works nicely with pro https://wordpress.org/plugins/host-webfonts-local/

Hey @bill_hodgson,

Thanks for sharing your idea, we really appreciate it!

Cheers!

hi,
i know this plugin and use it on several websites. but would be great if such a function will be integratet in PRO. so we dont need another plugin. :slight_smile:

Hi @deranaloge,

My colleague has already added this as a feature request, so our development team will consider this in the future.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.