knuspermedia Local Fonts & Icons

Description

When a page loads Google Fonts or Font Awesome from their servers, every visitor’s browser sends its IP address to Google or Font Awesome. German courts have ruled that this can violate the GDPR (DSGVO).

knuspermedia Local Fonts & Icons finds these fonts and icons on your pages, downloads them once to your own server and rewrites the page, so visitors only load them from your domain. It works automatically after activation, no configuration needed.

This plugin is not affiliated with Google or Fonticons, Inc. (Font Awesome).

What it handles

  • Google Fonts stylesheets (CSS API v1 and v2), reduced to the subsets you need, with font-display: swap
  • Font Awesome stylesheets from its own CDN and from cdnjs, jsDelivr and BootstrapCDN
  • Font Awesome’s JavaScript version and Font Awesome Kits, replaced by the local stylesheet of the same release (Font Awesome Free for kits)
  • @import of Google Fonts / Font Awesome inside theme and plugin stylesheets, also nested
  • Inline styles, URLs inside inline scripts and JSON, and the Web Font Loader (replaced by a copy bundled with the plugin)
  • preconnect / dns-prefetch hints to these servers
  • Fonts that scripts add later in the browser (sliders, page builders, maps), blocked by an optional JavaScript guard
  • Local file paths contain no third-party host names, so source code scanners don’t report false positives

Only stylesheets and font files are stored, in wp-content/uploads/knuspermedia-local-fonts-icons/. The plugin never stores JavaScript.

Check your pages

Under Settings Local Fonts & Icons you can check any page of your site for remaining references to Google Fonts or Font Awesome, see which files were stored locally and clear the cache. Common page cache plugins (WP Rocket, W3 Total Cache, LiteSpeed Cache, WP Super Cache, Autoptimize and others) are purged automatically.

This plugin is a technical tool. It does not provide legal advice and cannot guarantee that your website complies with the GDPR or any other law.

WP-CLI

  • wp local-fonts-icons flush deletes all local copies and purges page caches
  • wp local-fonts-icons scan [<url>] checks a page for remaining references

External services

This plugin works as a download service for files your site already loads from third-party servers. It contains the host names of these servers only to recognize their URLs in your pages and replace them with local copies. Visitors’ browsers never request anything from these servers because of this plugin; that is what the plugin prevents. No account is needed for any of the services.

Your server contacts a service only when one of your pages references a file from it: once per file, on the first page view after the file appears on your site, after the cache is cleared, or when you use “Check page”. Each request sends the URL of the requested file, your server’s IP address, a browser user agent string and your site’s address as referrer (Font Awesome Pro and Kits only deliver files to registered domains). No data about your visitors is sent.

Google Fonts (fonts.googleapis.com, fonts.gstatic.com), provided by Google LLC: used to download the Google Fonts stylesheets and font files your pages use. The Web Font Loader on ajax.googleapis.com is never contacted; the plugin uses its bundled copy instead.
Terms of Service, Privacy Policy

Font Awesome (use.fontawesome.com, pro.fontawesome.com, kit.fontawesome.com, ka-f.fontawesome.com), provided by Fonticons, Inc.: used to download the Font Awesome stylesheets and fonts your pages use, and to read the version of a Font Awesome Kit.
Terms of Service, Privacy Policy

jsDelivr (cdn.jsdelivr.net; BootstrapCDN at maxcdn, stackpath and netdna.bootstrapcdn.com is served by jsDelivr): used to download Font Awesome files your pages load from jsDelivr or BootstrapCDN, and the Font Awesome Free files that replace a Font Awesome Kit.
Terms of Service, Privacy Policy

cdnjs (cdnjs.cloudflare.com), provided by Cloudflare, Inc.: used to download Font Awesome files your pages load from cdnjs.
Terms of Service, Privacy Policy

You can switch off Google Fonts or Font Awesome handling separately in the settings; the plugin then doesn’t contact that service.

Bundled libraries

  • Web Font Loader 1.6.28 by Adobe Systems and Google, Apache License 2.0, in assets/vendor/webfontloader/ (minified as published; source code at the link). Used instead of the copy on Google’s CDN when a page loads Google Fonts through the Web Font Loader.

Installation

  1. Upload the plugin through Plugins Add New or copy the knuspermedia-local-fonts-icons folder to wp-content/plugins/.
  2. Activate the plugin. If you use OMGF, deactivate it, so the two plugins don’t interfere.
  3. Visit your site once, then go to Settings Local Fonts & Icons and use “Check page”.
  4. Clear your page cache if your cache plugin isn’t purged automatically.

FAQ

Does it work with page builders like Divi or Elementor?

Yes. Fonts the builder adds to the page are localized, and fonts its scripts add later in the browser are blocked by the JavaScript guard. The plugin doesn’t run inside the builder’s editor preview.

What happens to Font Awesome’s JavaScript version?

The script (e.g. js/all.min.js) is replaced by the stylesheet of the same release (css/all.min.css). Icons look the same; features that only exist in the SVG version, such as layers, masking and power transforms, are not available. A script enqueued through WordPress is replaced right away, a script tag that a theme prints directly from the next page view on; common page caches are purged once at that moment, so the first view isn’t kept.

What about Font Awesome Kits and Pro?

A kit that is enqueued through WordPress is replaced right away. A kit whose script tag a theme prints directly is removed and replaced from the next page view on. Kits are replaced by Font Awesome Free, so Pro icons and custom kit icons are missing; bundle the Pro files with your theme instead. Pro stylesheets loaded from pro.fontawesome.com are mirrored if your domain is allowed in your Font Awesome account.

Does it cover the login page?

Yes, for stylesheets and scripts enqueued through WordPress. The login page is not a template, so WordPress doesn’t buffer it and files that a plugin prints directly there stay untouched.

Does it handle Google Maps, reCAPTCHA or YouTube?

No. Only fonts and icons are handled. Other Google services need consent from your visitors, e.g. through a cookie consent tool. Fonts that Google Maps adds in the browser are blocked by the JavaScript guard.

How can I see a page without the plugin?

Append ?nowpdf to the URL.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“knuspermedia Local Fonts & Icons” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.4.0

  • Requires WordPress 6.9: pages are rewritten through the template enhancement output buffer of WordPress instead of an own output buffer.
  • On the login page, enqueued stylesheets are replaced directly.
  • Stylesheets are located through the WordPress functions for themes, plugins and uploads, which also works when these are on their own host.

1.3.0

  • JavaScript is never stored: Font Awesome’s JavaScript is replaced by its stylesheet, the Web Font Loader is bundled with the plugin.
  • SVG files are no longer stored.
  • Local copies are stored in uploads/knuspermedia-local-fonts-icons.
  • When a Font Awesome script printed by the theme is removed for the first time, page caches are purged once, so the page without its replacement stylesheet isn’t kept in the cache.

1.2.0

  • Renamed to knuspermedia Local Fonts & Icons.
  • Font Awesome Kits are replaced through wp_enqueue_style, the JavaScript guard is added through wp_add_inline_script.
  • Translations come from translate.wordpress.org instead of bundled files.
  • Removed support for Font Awesome from unpkg.

1.1.0

  • Admin interface in English and translatable.

1.0.2

  • The JavaScript guard also blocks fonts that are inserted as HTML strings (e.g. Divi sticky elements).

1.0.1

  • Local file paths no longer contain third-party host names.

1.0.0

  • First release.