How to Host Google Fonts Locally WordPress

How to Host Google Fonts Locally WordPress Without Plugin

Do you want to host google fonts locally? WordPress has many plugins to host google fonts locally. But if you install a plugin for that then the problem is not solved. If you can solve this issue yourself. You no need to install any plugins. In this article, You will learn, How to Host Google Fonts Locally WordPress.

Then let’s start to download your favorite font. Follow the article.

Download Google Font Files

Google Fonts is a library of free, open-source fonts that can be used on websites or downloaded for use in graphic design and word processing. The library includes a wide range of typefaces in different styles, including serif, sans-serif, display, handwriting, and more.

According to google, There are 1482 open-source font families in google fonts.

First, go to Google Fonts and select a font. Select and open your favorite fonts.

How to Host Google Fonts Locally WordPress

Click download family. And your font family will start downloading.

Reference in Your CSS Stylesheet

Google fonts are so simple. Google hosts a font ttf file and some CSS code for a font family. If you can host those files locally. That font family works locally.

First. You downloaded the fonts file. I think You got a ZIP file. Extract it. After extracting, you will get ttf file.

@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/GreatVibes-Regular.ttf') format('woff2');
}

Remember, Use your own file location and own font family name. Then Use it.

body{
  font-family: 'Great Vibes';
}

Conclusion

Hosting Google Fonts locally on your WordPress site without a plugin is a simple process that can improve the speed and performance of your website. By using the CSS @import method or adding the code directly to your theme’s stylesheet, you can easily access the Google Fonts library and choose the font that best fits your website’s design. 

This method not only saves time and resources, but it also ensures that your website will continue to load quickly, even if the Google Fonts server is down. Whether you’re a website owner or a developer, hosting Google Fonts locally is a great way to optimize your WordPress website and improve user experience.

See More:

How to Add Different Menu to Different Pages in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *