Do you want to Host Google Font in WordPress Locally without using any plugins? Then you are landed in the right place. This guide will show you how to download & host (.woff) custom Google font in WordPress without a plugin.
We will walk you through downloading Google Fonts from the official Google Fonts website and uploading them to your own hosting. We use Hostinger in this guide, but the steps work the same for any hosting.
Hosting our Google font on our own server increases the speed of the website & avoids the annoying error in page speed insights.
This Tutorial will Teach You How To Host Google Font In WordPress Locally By Without Installing Extra Plugins. Installing Plugin For Doing Simple Task Can Make Your Website Load Slow.
Plugins Come With a Lot Of Additional Files Which Take Resources and also increase the number of HTTP requests made to the server.
Also Read: How To Add Table Of Content In Blogger
Also Read: Blogger Template Development From Scratch
Step 1: Go To Google Fonts & Search For The Font That You Like. I am going to use Poppins font.
Step 2: Click On the Get Font Button As Shown In the Following Image:
Step 3: Click On Download The Font As shown In the Following Image:
Step 4: Extract The Font Folder & Name The Folder Font As Shown In Following GIF:
Step 5: Go To The File Manager Of Your WordPress Hosting And Navigate to the Public_HTML Folder As shown in the following Image:
Step 6: Open The Public_html Folder & Upload the extracted font folder In the previous step as shown in the following image:
Step 7: Now Our Almot Work Is Done. Now Go To Theme Filer Editor Of Your WordPress Website as shown in the following Image:
Step 8: Identify and open the main style.css file of your WordPress theme & paste the following code ( Font-face ) as shown in the following image:
@font-face {
font-family: 'Poppins';
src: url('https://javascriptsmagic.com/Font/Poppins-Regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}
Step 9: Update the source URL. The source URL is structured as:
src: URL(‘{Website Name} /Font/Regular Font File.woff { format(‘woff’) }’)
You have to replace the URL with your website URL. Then go to the font folder that we have uploaded in previous steps copy the file name of the regular font and place it in the above URL Structure:
To Test The Font That We Have Hosted On The Local Server We Have To Clear The Cache Both From The Server & From our browser To See The Changes.
You Can Clear The Cache Of Your Website If You Are Using Any performance optimization Plugin. To Clear Cache From Your Browser Press the ‘CTRL + SHIFT + Delete’ Key.
To Verify The Font Is Loading From Our Own Server You Can Check From The Dev Tools Available On Your Browser As Shown In the Following Steps:
I Hope You Understand How You Can Host Google Fonts in WordPress Locally. But There Are Things You Need To Keep In Mind Will Avoid The Errors Like Fallback Fonts Appearing & Fonts Not Displaying Properly.
These Errors Are Caused To Incorrect File Paths, Browser Compatibility, Incorrect Font Weight Styles & Cache Issues.
You Also Need To Keep An Eye On Performance Issues Which Are Due To Hosting Google Fonts in WordPress Locally. To Avoid performance issues Consider The Following Steps:
Last Updated: July 2, 2024