How to load Google Fonts and GStatic files from your server

Written By Wolfgang Geiger

WordPress developer in Hong Kong specializing in making websites work in Mainland China. More information on the About Me page

To make sure your website is loading with decent speed in Mainland China, you want to load all (or almost all) files directly from your server.

When you add Google Fonts to your site, they usually either get loaded from a Google server or via GStatic, both of which don’t work well in China, at least not reliably. They might load fast one day, but on others, they might load very slowly – we’re talking about 40-60 seconds.

So what you need to do is first load the fonts and files onto your server to then have users load it from there.

Sounds complicated, but there are plugins to help. There are two main ways to do this:

  • If you are using a caching plugin, it might already have that functionality included. Look through the settings and if you find a setting that says something like “Load Google Fonts from server” then tick that and you should be fine
  • If you don’t have that option, I would suggest to use the OMGF plugin

Setting up the plugin

Here are the steps to get the plugin installed and set up (before you install the plugin, make sure you have a backup of your website in case something goes wrong):

  • Go to Plugins and then click on Add New Plugin
  • Search for OMGF
  • Click on Install Now and once done on Activate
  • Go to Settings and click on Optimize Google Fonts
  • Next look for Cache Status and click on the Start Optimization link.
  • You should then see a list of Google Fonts that got loaded onto your server

That should be all you have to do to get this problem solved.

If things are not working

If the above 2 methods don’t work, you’ll have to do things manually.

You can dequeue fonts, CSS and Javascript files and then add them manually again by uploading them to the server and enqueuing them via plugin or child theme.

You’ll probably need some help from a developer for that though.

If you have questions or need help with your website, click on the button below to get in touch.

I'm looking forward to hearing from you!

Get in Touch