The themes team at WordPress.org is revising its advice on Webfont hosting in light of a recent German court case that resulted in a fine for a website owner who used Google-hosted web fonts in violation of the GDPR. For greater speed, the majority of theme writers enqueue Google Fonts from the Google CDN, although doing so exposes users’ IP addresses.
The Themes Team will explore prohibiting remotely hosted typefaces at their upcoming meeting and is also thinking about doing so.
Benachi, who serves the role of Themes Team Representative at WordPress, had the following to say:
The themes team strongly encourages the theme authors to update their themes. We recommend updating by switching to locally hosted web fonts. Luckily Google Fonts can be downloaded and bundled in a theme. Bundled font files allow users to host web fonts locally and comply with GDPR.
All of the default themes from Twenty Twelve through Twenty Seventeen are now being updated by core contributors to utilize locally hosted web fonts. The task has been brought up before, but a recent discussion on the German support forums reignited the conversation. A user who used the Twenty Seventeen theme to build a tiny website said that he had received threats from website visitors after they cited the German court decision. If the site owner disobeys and continues to utilize Google Fonts to furnish Google with IP addresses, the judgment threatens punishment of €250,000.00 for each instance of infraction or, alternatively, six months in jail.
Jessica Lyschik, who serves the role of Contributor at WordPress, had the following to say:
While in the newer default themes fonts got added as an asset, the older default themes remained untouched. This can cause issues with users not being aware of both the legal stuff and the fact that Google Fonts are directly used in default themes. We think while it is still widely among plugins and other themes to use Google Fonts directly, the default themes of WordPress should be able to be used risk-free and compliant with the GDPR.
The Themes Team suggests writers refer to the Twenty Twenty-Two theme to learn how to bundle locally hosted Webfont files using theme.json. You may also follow the Implementing a Webfonts API in WordPress Core guide if you’re using functions.php.
The themes team strongly advises theme authors to update their themes by using locally hosted webfonts. Luckily, Google Fonts can be downloaded and bundled into a theme. Read more in this article from @wptavern #webfonts #wordpress #google #fonts #GDPRhttps://t.co/VCzPgOGG8n
— BlackHOST (@_blackhost) June 21, 2022
Many theme creators could wait to update their themes until they are compelled to do so by a WordPress.org ban. In the meanwhile, users could try adding a plugin to host web fonts locally. The Local Google Fonts plugin by WordPress developer Xaver Birsak automatically locates Google font sources and provides users with the option to download and use them locally.
This plugin looks for fonts that have been wp en queue style-embedded. Users who are embedding Google fonts through @import will need to alter that before using the plugin. As of right now, it will automatically download updated font versions. It was designed by Birsak to be a set-it-and-forget-it type of plugin. For non-technical users who have a theme that the author hasn’t yet updated, this could be an excellent choice. WordPress.org offers Local Google Fonts without charge.
The OMGF – Host Google Fonts Locally plugin, another free plugin alternative on WordPress.org, includes a few extra capabilities. It allows users to define a fallback font stack, preloads fonts to decrease Cumulative Layout Shift above the fold, unloads fonts not needed by the theme or plugins, and switches font families for the system fonts to accelerate loading times. Multisite support and more sophisticated features are available in the commercial edition.