How to disable Astra theme Fonts (updated)

astra theme templates

Loading fonts from Google Fonts and others can be a problem according to the privacy legislation in some countries of the European Union so sometimes it is convenient to deactivate them.

If you use the Astra theme and have this need the process is not complicated.

The first thing you have to do is to save the fonts locally in your server.

Once this is done the next step is to add this code to the functions.php file of the Astra child theme:

//Disable Astra Fonts
add_filter( 'astra_enable_default_fonts', '__return_false' );Code language: JavaScript (javascript)

Once this is done you can use the customizer to configure Astra to your liking. When you’re done take a look at the source code of the page to identify the Fonts that are loaded on the page.

chrome console fonts

All that’s left is to use the Google Webfont Assistant to generate the required CSS and download the font files you need. Add it to the child theme’s style.css file and your local Google Fonts will be loaded instead of the remote ones.

Important Note: Since Astra 3.3, default font icons have been replaced by SVG icons so, if you enable SVG support, the astra.woof font file won’t be loaded anymore. Thus, the above code would be no longer needed unless you want to disable SVG support.

How useful was this post?

Click on a smiley to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

1 thought on “How to disable Astra theme Fonts (updated)”

Leave a Comment

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

Scroll to Top