Buy All 65 Premium WordPress Themes for $59.99
No Additional Fees, Pay Once and Use Unlimited Time for Unlimited Domains, Free Lifetime Updates

How to Deactivate Google Fonts from a Theme

Most of our premium themes comes with built-in functionality for loading Google Fonts (default fonts loaded in style.css and custom fonts which can be set from Admin Panel -> Left Menu -> Appearance -> Customize -> ‘Font’ section.

In case you want to fully remove Google fonts from your website, it will require some small code changes. Here are all of the necessary steps:

1. Remove Google Font from style.css

Login to your Admin Panel -> Left Menu -> Apparance -> Editor -> open style.css for edit.

Search for ‘@import url’ and DELETE all of these occurences, i.e.

@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700|Josefin+Sans:400,700');

2. Open header.php and DELETE all google fonts includes (if any) such as:

<link rel="preconnect" href="https://fonts.googleapis.com">
		<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css?family=<?php echo $fontName; ?>&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,400i,700|Raleway:300,400,500,600,700|Crete+Round:400i" type="text/css" />

3. Add CSS for Fonts

Now all fonts are removed, but it’s a good idea to set some of the out-of-the-box fonts i.e. Arial for your website. It can be done by logging to your Admin Panel, then navigate to Left Menu -> Appearance -> Customize -> ‘Additional CSS’ section and insert the following code:

body {
	font-family:'Arial', sans-serif;
}

h1, h2, h3, h4, h5, h6{
	font-family: 'Arial', sans-serif;
}

#navmain {
	float:right;
	font-family: 'Arial', sans-serif;
}

Leave a Reply