Ben is a lifelong Nintendo fan who likes to build websites, and make video games. He buys way too much Lego.
Recently there’s been a number of court cases in Europe suggesting that Google Fonts are not GDPR compliant. The issue is that when you link to a Google Font (using their CDN) you could pass along personally identifiable information allowing Google to track users around the internet.
Whether Google do this or not is irrelevant, the possibility is there – and that’s enough to make it a possible privacy violation. As such, WordPress has suggested theme developers change their themes to not use the Google Fonts CDN and instead self host the fonts.
Another alternative is Bunny Fonts. Bunny is a privacy focused content deliver service and they have their own Google Fonts proxy. They are a drop in replacement for Google Fonts, just change the url and you’re done.
Personally I don’t think Bunny Fonts is the best solution, self hosting the fonts is probably the best thing you can do: all Google Fonts are open source and can be distributed with your themes or on your websites. But not everyone has the technical nohow/ time/ whatever. So I made a super simple plugin that makes the switch for you.
This plugin will only work for themes that enqueue fonts as styles (using
wp_enqueue_styles), so it may not work for everyone. But this is how I embed fonts with my themes and so maybe it will be useful to other theme users too.
The code is hosted in a Github Gist. You can download it by going to the Gist page, pressing the download button in the top right, and then installing through the WordPress admin like you would any other downloaded plugin.