Unnecessary Google Font Loading

I noticed that the Pro theme is unnecessary loading the Lato Google font in the header, even though I am not using that font at all. I’m assuming this is because I’m using the Renew stack, but nonetheless, this is very inefficient and creates more load time for users.

Is this just how it is, or is there a way to prevent this? It seems like this should automatically be taken care of (i.e. if you’re not using the font, dequeue it automatically).

2 Likes

Hi,

To prevent it, you can add the code below in your child theme’s functions.php file.

add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
	wp_deregister_style( 'cs-lato');
}

Hope that helps.

Have to agree with @drewcarver here. Would be better if Lato isn’t loaded at all when other fonts are configured in Pro.
Thanks

1 Like

Hi there,

It’s a fallback font since browsers can have their own set of fonts (system fonts). It will be more annoying to see your site displaying different font everytime you view it in each browser.

Plus, the font options in the settings are only applicable to specific elements like body, headline, links and etc. Some element has its own local font styling. Still, if you prefer, you can remove that by adding the above code.

Example, the Calibri is a Windows font, it will not appear as Calibri in iOS or Mac, but another system font.

Thanks!

Great, thank you.

And I suppose the point is that the more Google Fonts we’re loading, the slower the performance of the website, which is not good for users or Google in terms of SEO.

1 Like

Hi Drew,

That does make sense but believe the impact is really noticeable, it won´t be that which will compromise your SEO.

Thank you