CAOS for Webfonts | Host Google Fonts Locally


CAOS for Webfonts is written with performance in mind. Other plugins make repeated requests to your Blog’s database to replace/remove requests to external Webfonts source (e.g. Google Fonts) on-the-fly. This might be user-friendly, but it’s a performance killer, because locally hosting your Google Webfonts should be a set-and-forget feature. The source of your webfonts should be replaced once and kept that way.

That’s why I kept CAOS for Webfonts small and useful. It uses the Google Fonts Helper API to automagically download the fonts you want to WordPress’ contents folder and generate a stylesheet for it. The stylesheet is automatically included to your site’s header and 100% compatible with plugins like Autoptimize or W3 Total Cache. After that, all you need to do is remove any mention of requests to external webfont sources (using e.g. a child theme or a plugin such as Autoptimize) and you’re done!

This will decrease your pageload times, leverage browser cache, minimize DNS requests and effectively bring you a perfect score on Pagespeed Insights and Pingdom, without taking toll on the performance of your webserver.


  • Easily find and download your fonts in multiple subsets,
  • Generate a stylesheet, which is automatically added to your header using WordPress’ wp_head()-function,
  • Change the caching path (where the fonts and stylesheet are saved) for increased compatibility with Caching- and Security-plugins, such as WP Super Cache, Autoptimize and WordFence,
  • Control font performance by adding font-display property,
  • Prioritize fonts with rel=’preload’.


  1. Upload the plugin files to the /wp-content/plugins/host-webfonts-local directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‚Plugins’ screen in WordPress
  3. Use the Settings -> Optimize Webfonts screen to configure the plugin

For a more comprehensive guide for configuration, click here.


I don’t know what I’m doing! Can you help?

Of course 🙂 But first calm down and read this comprehensive guide on how to configure CAOS for Webfonts. If you have any questions afterwards, visit the Support Forum.

I have another file I want to host locally. Could you make a plugin?

Maintaining two plugins besides my daily 9-to-5 job is a handful, so no. If you’re looking for a way to host analytics.js locally; please install CAOS for Analytics. For anything else, please follow the steps in this how-to.

How come my font isn’t available in CAOS for Webfonts?

This could be for several reasons:
1. Have you checked if your font is available on Google Fonts?
1. Is your font listed as an open source font, or is it a premium font? For obvious reasons, CAOS for Webfonts only has access to open source fonts.

Can I serve the fonts from my CDN?

Yes, you can. Enter the url of your CDN and re-download and re-generate the stylesheet. Then the fonts will be saved to and served from your CDN.

Does this plugin edit template files?

No, it does not. It creates a CSS Stylesheet which will be automatically added to your theme’s header using a built-in WordPress queueing system.

My fonts aren’t being downloaded! What’s going on?

First check your database if the table {prefix}_caos_webfonts exists. If you’re using any caching plugins, such as Autoptimize, W3TC or WP Super Cache, empty their caches. After that empty your browser’s cache and reload the page. Try again.

The stylesheet isn’t loaded? What’s going on?

CAOS for Webfonts enqueues the stylesheet into WordPress’ head. If the stylesheet isn’t loaded, this probably means your theme isn’t implementing the wp_head() function into it’s header section.

Does this plugin support Multi Site?

Yes, it does!

Can I buy you a beer?

Yes, please! Click here to buy me a beer!


Lipiec 9, 2019
I used to do that manually, which was fine but quite annoying. Your plugin saves me a lot of time. Not only it works great but it has some cool feature. Thanks again to make our life easier 😉 Cheers
Czerwiec 21, 2019
It's clear that this plugin is helping some people. I had a different experience however. Now to be fair, my website is loading anywhere between 1.4 and 2.6 seconds during tests. But it always mentions google fonts as being an issue, so I thought i'd try this plugin. Once I activated it and downloaded the webfonts etc, all tests I did changed my websites load time to between 5 and 8 seconds. I checked the timings and on every single occassion the new fonts.css was the issue for some reason. I deactivated the plugin and everything is back to normal.
Maj 25, 2019
As I loved the google fonts, I did not like the fact that I had to wait for them to show up on my theme when they got fully loaded. Now hosting them locally resolved me a lot of loading time and my theme looks more professional because I won't change the font layout until the "slow" Google fonts are loaded. Also promoted it on CMM (centmin mod) to use your plugin on the default installer, but not allowed to post links here. We use Autoptimze by default, so disabling the Google fonts was a job of just a click. Again, thanks for your time that you spend in creating this great plugin, just looking to host other js locally. Also it works on WP 5.
Maj 4, 2019
Even this Plugin does the job, why making things more complicated as they are? First loading google fonts and then trying to eliminate fonts not used? There is a tiny plugin which does all the huzzle more efficient and even much more easier. The plugin just takes the Google Fonts already in use and stores them locally, done. Plug and Play with no docs and no do this and that.
Przeczytaj 15 recenzji

Kontrybutorzy i deweloperzy

„CAOS for Webfonts | Host Google Fonts Locally” jest oprogramowaniem open source. Poniższe osoby miały wkład w rozwój wtyczki.


Log zmian


Minor code optimizations.


Cleared up instructions in Welcome Panel.
Added option to remove version parameter from stylesheet request.


Updated welcome panel.


Quick-fix for re-triggered SQL queries.


XSS hardening in stylesheet generation form.


Added CDN support.


Fluid progress bar now functions correctly and doesn’t make any unnecessary Ajax-requests.
Replaced all success-messages with notifications inside the buttons, to increase UX.


Improved search by adding support for comma-separated lists. Fixed some 404s in welcome panel and minor JavaScript optimizations.


Minor usability updates.


Added support for subsets to increase compatibility with other writing.


Changed domains to new home:


Added experimental option for preload resource hint.


Replaced download counter for progress-bar. Refactored logic for AJAX-requests for better


Optimized AJAX-requests for download-counter.


Added a clean-up button, which cleans the currently configured cache-dir.


Plugins admin-JS and -CSS is now updated by force after plugin update to prevent malfunction.


Added a download counter, clean queue-button and improved allround UX. Fixed a few minor bugs.


Fixed a bug where sometimes the fonts weren’t downloaded yet when the stylesheet was generated.


CAOS for Webfonts now remembers which fonts you use, to make it easier to edit your stylesheet.


Added option to change font-display strategy.


Added option to change cache directory.


Fixed bug with detecting wp-content directory.


Fixed Multisite Bug.


Revert accidental commit


Tested with WP 5+


Changed order of loaded fonts to improve compatibility in Firefox. [Reported by @lofesa]


When plugin is deactivated, enqueued styles and scripts are removed. Fixed bug where fontnames containing multiple spaces did not return any results. Added console log when no results are returned.


Finally added ‚Settings’-link to Plugins-page.


Further security measures to remove Path Traversal vulnerabilities.


Added security measures to prevent XSS.


Fixed bug where ‚remove’ would sometimes remove two rows.


Complete overhaul of the plugin. Fonts are now searched using the Google Fonts Helper API and


Fixed bug where the plugin would sometimes permanently change your uploads-directory to /local-fonts.


Changed to Github.


First release! No changes so far!