OMGF | Host Google Fonts Locally


Leverage Browser Cache and Minimize DNS requests with OMGF (Optimize My Google Fonts, formerly known as CAOS for Webfonts).

OMGF is written with performance and user-friendliness in mind. 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 CSS and JS optimizing/minification plugins like Autoptimize or W3 Total Cache. OMGF can efficiently remove any requests to external Google Fonts (loaded from or

That’s it. 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.


  • Automatically detect which Google Fonts your theme is using or,
  • Easily find additional fonts in any/multiple subsets,
  • Download them and 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 Multisite environments and Caching- and Security-plugins, such as WP Super Cache, Autoptimize and WordFence,
  • Serve your fonts from your CDN,
  • Enable Typekit’s Web Font Loader to load your fonts asynchronously and further increase your Pagespeed Insights score (!),
  • Preload the entire stylesheet or just fonts loaded above-the-fold,
  • Control font performance by adding font-display property,
  • Auto-generates the local source for webfonts,
  • Automatically remove any fonts loaded from or

Please keep in mind that, although I try to make the configuration of this plugin as easy as possible, the concept of locally hosting a file or optimizing Google Fonts for Pagespeed Insights or GT Metrix has proven to be confusing for some people. If you’re not sure of what your doing, please consult a SEO expert or Webdeveloper to help you with the configuration and optimization of your WordPress blog. Or hire me to do it for you.


  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 OMGF. 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 anything else, please follow the steps in this how-to.

How come my font isn’t available in OMGF?

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, OMGF 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.

How can I make sure the fonts load asynchronously AKA non-render blocking?

Enable Typekit’s Web Font Loader in the settings and OMGF will take care of it for you!

I’m getting a ‘Load resources from a consistent URL’ after installing and configuring this plugin. What’s going on?

This must be, because you’re still loading the externally hosted Google Fonts, besides the fonts you downloaded using OMGF. Try checking the option ‘Remove Google Fonts’ and see if that helps. If it doesn’t consider using a child theme to ‘dequeue’ any external requests. If you don’t know how to do that, please contact me.

I have ‘Remove Google Fonts’ enabled, but the fonts from| are still loaded. What’s going on?

The option in OMGF removes any fonts that are loaded in the conventional way. However, if it doesn’t work for you and you’re using a popular theme, I’d love to help and make OMGF compatible. So don’t hesitate to contact me.

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 it doesn’t, remove the caos_webfonts_db_version from the wp_options table and reload the page. The table should be created and the issue should be resolved.

If the issue still persists and 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?

OMGF 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? I’m getting CORS errors!

Yes, it does. When using subdomains, however, you might run into CORS related issues. To get around this, you should configure each site separately. Do the following:

  • Go to the site’s own dashboard,
  • Change OMGF’s cache directory (Save webfonts to…) to something unique, e.g. /cache/site1/omgf,
  • Click ‘Save Changes’,
  • If you haven’t already, find the fonts you want to use,
  • Click ‘Download Fonts’ and wait for the process to finish,
  • Click ‘Generate stylesheet’.

Repeat this for every site you want to use with OMGF. A new stylesheet, using the corresponding site’s Home-URL and cache directory for each font, has been generated. Bypassing any Cross-Origin Resource Sharing (CORS) issues you might run into.

Is this plugin compatible with WPML?

No, not yet. But I will definitely try to make it compatible in the future!


2020 年 2 月 16 日
I had the plugin installed by the author, and it does what it's supposed to do. I got a page load increase after it was installed.
2020 年 2 月 13 日
Do the job. Simply Fonts autodetection is awesome
2020 年 2 月 12 日
Having previously avoided google fonts due to the tracking potential, using custom fonts was far more hassle than it should be. This fantastic plugin has let me have all the benefits of google fonts without sacrificing the privacy of my site visitors - perfect. Install, follow steps and it just works!
閱讀全部 44 則使用者評論


以下人員參與了開源軟體〈OMGF | Host Google Fonts Locally〉的開發相關工作。


OMGF | Host Google Fonts Locally 外掛目前已有 3 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將 OMGF | Host Google Fonts Locally 外掛本地化為台灣繁體中文版


任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄



Updated Welcome-panel with WoOSH!-services.
Preload can now be used for certain fonts only (also combined with Web Font Loader).


Filenames are now rewritten to be more informative and for easier debugging.


Added option to use relative URLs in the generated stylesheet.


Added experimental enqueue order option.


Fixed bug that would throw excessive notices if PHP logging is enabled.
fonts.css was loaded too late, so some minification plugins couldn’t capture it.


Throw clear error if any of the new tables don’t exist. To prevent confusion.


Forget to up static version after changes to Admin JS files.


Throw errors less aggressive.


Improved overall error handling for Auto Detect and downloading using cURL.


Auto-detect is now loaded before ‘Remove Google Fonts’ and both are loaded absolute last.


Improved UX for error message when Auto-detect doesn’t work properly.


Added long overdue migration script for options and tables. Code optimizations.


wp-block-editor style is now ignored when detecting stylesheets that depend on Google Fonts, when the remove function is enabled.


Added uninstall script.


Fixed bug where tables weren’t created upon installation. Moved logic to plugin activation, instead of ‘plugins_loaded’.


No new features or bugfixes. Just a re-arrangement of the support tab to be more in line with the new feature set.


Code clean-up in Generate-script. Improved error-handling.


Added error handling for when certain URLs return ‘undefined’ from Google Fonts API. Auto-detect now loads detected fonts immediately after settings page refresh. Code optimizations.


Added compatibility for (more efficient) chained requests to Google Fonts (separated by a pipe (|)) to the Auto-detect feature. Some themes (like Twenty Sixteen) use this feature.


Bugfix where Auto-detect would retrieve the fonts used by WordPress’ Administrator area, instead of the frontend.


Complete overhaul of code. Major performance upgrades. Added Auto-detect feature.


Fixed 400-error when re-downloading fonts. Added compatibility for Enfold-theme.


Fixed bug with include paths.


OMGF now retries downloading the fonts using fopen, if the cURL attempt failed. Code improvements.


Further improvements for downloading of analytics.js.


Tested with WP 5.3 and replaced fopen() with cUrl to make OMGF compatible with servers that have allow_url_fopen disabled.


Added error handling to DownloadFonts-script.


Using Typekit’s Web Font Loader only uses 1 SQL query in the frontend now, regardless of how many fonts you use.


Added Typekit’s Web Font Loader to allow loading fonts asynchronously.


Fixed bug where a few strings couldn’t be translated. Improved responsiveness of settings-screen. Minor re-factor for better structure.


[Urgent] Errors in some translation strings.


Fixed ‘duplicate column’-error when WP_DEBUG was enabled. Fixed bug which broke preload. Preload is now automatically skipped if you have any CSS optimization plugins enabled.


Updated Multisite documentation.


Updated documentation.


Fixed bug where preload would cause issues.


‘Remove Google Fonts’-options now re-enqueues styles that were dependent on removed Fonts.


Small improvement to ‘Remove Google Fonts’-option.


Made all strings translatable.


Changed name to OMGF, because it’s hilarious?


New feature! OMGF can now remove fonts from or automatically.


Extended support for local source attribute.


Correct support for Legacy IE browsers (EOT).
Added ‘local’-attribute to stylesheet.


Load EOT-files first in stylesheet.


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.


OMGF 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!