Recently, there have been a number of court cases in Europe suggesting that Google Fonts may not be GDPR compliant. The concern is that when you link to a Google Font using their CDN (Content Delivery Network), it could potentially transmit personally identifiable information, which allows Google to track users across the internet.
The actual practices of Google in this regard are not the main issue; rather, it is the mere possibility of privacy infringement that raises concerns. Consequently, WordPress has recommended that theme developers modify their themes and avoid using the Google Fonts CDN. Instead, they should self-host the fonts to ensure compliance with GDPR regulations (source: WordPress Themes Blog).
Another alternative is Bunny Fonts. Bunny is a privacy focused content delivery service (CDN) 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.
While Bunny Fonts can be considered as an alternative solution, my personal recommendation would be to self-host the fonts. All Google Fonts are open source and can be distributed along with your themes or on your websites. However, I understand that not everyone possesses technical knowledge or has enough time available for such tasks. As a result, I have developed a simple WordPress plugin specifically designed to make this transition easier for you.
Please note that this plugin will only work with WordPress themes that enqueue fonts as styles using wp_enqueue_styles
. Therefore, it may not be compatible for everyone. Nevertheless, if you embed fonts within your WordPress themes in a similar manner as I do, this plugin might prove useful for other theme users as well.
Below is the code snippet hosted on Github Gist:
To download the code, visit the Gist page and click on the download button located in the top right corner. Install it through the WordPress admin interface just like any other downloaded plugin.
Was it good/ useful/ a load of old rubbish? Let me know on Mastodon, or BlueSky (or Twitter X if you must).
Link to this page
Thanks for reading. I'd really appreciate it if you'd link to this page if you mention it in your newsletter or on your blog.