Hire Dedicated WordPress Developer Learn more
Did you know that installing local fonts in your WordPress can drastically slow your website’s loading speed?
Although WordPress is an easy-to-use CMS, a few doubts prevail in the developer's mind while designing a website. One common conflict is adding local fonts to the platform without hindering the website’s speed.
Fortunately, there is a way out. One can utilize the latest Webfonts Application Programming Interface (API) introduced in WordPress 6.0. This enables you to host fonts locally so they load faster. Let’s now see how you can do it without compromising the website’s speed.
Methods to Install Local Fonts on your WordPress
There are two methods that you can use when it comes to installing local fonts on your site without reducing its loading speed.
Method 1: Hosting Local Fonts with the Help of a Plugin
The first step in this method is to install the OMGF (Optimize My Google Fonts) plugin. Do not have any idea about installing plugins? Opt for suitable WordPress Partners for assistance.
OMGF is the most preferred WordPress Typography plugin that enables users to enhance performance and GDPR compliance by hosting Google Fonts locally. Once you have installed this plugin, you must go to Settings->Optimize Google Fonts to configure the same.
Here, click on the ‘Optimize Fonts’ tab and scroll down the settings page until you locate the ‘Font-Display’ option. You must ensure it's set to the Swap (recommended) option. Click the ‘Save & Optimize’ button to save these settings. You will notice a popup notification displaying the message: Optimization completed successfully.
Method 2: Hosting Local Fonts Manually
Another method is to manually host fonts without the need for a plugin. Although this is comparatively a tedious process, you will be able to use almost any font you prefer on your site.
The first step involves downloading your favourite fonts in web format. You can find stunning fonts from popular websites like web fonts, Typekit, FontSquirrel, and Google Fonts. Next, upload these files on your WordPress hosting server. You can do this with FTP or using your host’s cPanel File Manager by creating a new folder named “fonts”.
Following that, load the font in your theme’s stylesheet using custom CSS. For this, add the code directly to your theme’s style.css file, or by operating the Additional CSS section of the theme customizer. Remember that the CSS you prefer would be dependent on your theme or where you use the local font.
Although adding local fonts can add a personalised touch to your website, doing it incorrectly can negatively impact its speed. The methods discussed above allow you to host local fonts on your WordPress Website without compromising your site’s speed. One involves using a plugin, whereas the other method is manual.
Looking for a WordPress Development Company that can help you with this?
Choose WordPress Website as we offer the best WordPress services in India. We have an expert team of 40+ dedicated WordPress developers who are always ready to help you out.
Contact us today for more information.