Using Google Fonts with WordPress
While they are easy to overlook, fonts are an incredibly important aspect of any website. They can give a good first impression and increase your conversions.
Google Fonts is one of the most popular font services because they offer well-designed fonts that can take your website to the next level. However, using Google Fonts with WordPress can also worsen your site’s performance if not utilized correctly.
Here are five tips to optimize your site on WordPress with Google Fonts.
1. Use Fewer Fonts
Do not go overboard with fonts. It can be appealing to use all sorts of cool fonts, but they can quickly slow down your site.
When you choose a font, you choose an entire font family that includes variations such as bold, semi-bold, light, medium, etc. The font Roboto for example has over 3,000 glyphs across the entire family. So if you choose multiple different font families for your site, it rapidly drags down the site’s performance.
Sticking to a single font family can help avoid performance issues.
2. Host Google Fonts on Your WordPress Server
Typically with Google Fonts, they are delivered to the user from a source other than your site. As expected, this means slower loading times that can negatively affect conversions. However, this can be avoided by hosting Google Fonts on your WordPress server.
When choosing a font in Google Fonts, select the download option. Then use FTP to put them in your content/uploads folder. From there, use your URL/font/FONT_FILE_NAME.file-extension in your stylesheet instead of the font host’s name.
Only load the fonts and styles that you actually need. Loading every single variation of the font can slow your site down.
3. Preload Google Fonts
Google Fonts are generally delivered from Google’s Content Delivery Network. While this is usually pretty quick, there are still issues that can arise.
If the fonts are not loaded in time, the visitor’s page will load with generic fonts. Once the actual fonts have loaded, the page will change to show them. This is better than waiting the entire time but is not a good look for your site.
This can be avoided by preloading fonts. This can reduce the load time by about 100ms, which can have a huge impact.
This requires you to pre-connect, as well as use a preload link in the stylesheet. This gets loaded via HTML into the <Head> area of the site.
CDN Planet has examples of HTML pre-connect on their website.
4. Optimize with a WordPress Plugin
As always, plugins are a great tool when it comes to optimizing your WordPress site for Google Fonts. They can minimize the amount of coding required, making your job easier.
There are tons of plugins available for optimizing Google Fonts. One of the most interesting is OMGF | Host Google Fonts Locally. It specifically optimizes fonts you are already using, making it easy to implement.
Like many WordPress plugins, there are free and paid versions. The free version only offers manual settings, which can make things more complicated. The free version also has fewer optimization options, so the paid version is recommended for the best results.
However, there are plenty of other options out there. Spend some time looking at the various offerings and seeing which one works best for your site. Just be sure to check that it is compatible with all aspects of your site to avoid any unexpected issues.
5. Use a Theme That Integrates with Google Fonts
Many WordPress themes do not naturally integrate with Google Fonts. This can make the optimization process more difficult. Themes that do integrate with WordPress however can make the optimization process much easier.
Using a custom theme can make optimization and customization a breeze. They allow things like adjusting font size, color, weight, and spacing to be done quickly and easily. They even make adjusting fonts for specific devices possible, allowing you to make your site match-made for whatever device is accessing it.
Google Fonts offer consistent and reliable fonts that can improve your website’s appearance. There’s a strong chance that your site already uses Google Fonts in some way.
However, without proper optimization, these fonts can worsen your site’s performance. By following the tips outlined in this article, you can take advantage of Google Fonts while avoiding performance issues.
Though these improvements may seem minor, they still can have a big impact on your site’s performance and the user experience.
Also check out: What are Web Application Firewalls (WAFs)