Archived topic
Removing Google Font from WordPress site's theme
1 reply · Started by shlomo on February 7, 2023
Our hosting company suggests that we need to remove the Google Fonts on my site's theme to increase my site's speed. You can refer to this link:
https://wordpress.ezoic.com/how-to-remove-google-fonts-from-your-wordpress-site/
Well, I already tried the option to add a wp_enqueue_style() function on functions.php, but it seems not working up until now. So, I am thinking maybe I've added a wrong $handle of the GeneratePress theme.
I want to know what is the exact $handle that I can use in order to make the wp_enqueue_style() function work for our site while using your theme or if there's simple workaround to this.
This time, this is the code I've added on functions.php:
/* TN Dequeue Styles - Remove Google Fonts from GeneratePress Theme*/
add_action( 'wp_print_styles', 'tn_dequeue_generate_fonts_style' );
function tn_dequeue_generatepress_fonts_style() {
wp_dequeue_style( 'generatepress-fonts' );
}
Will wait for your response. Thanks!
Hi there,
ignore that guide.
Just go to the Customizer > Typography, and remove any Google Fonts you have set, and replace them with a system stack.
If you want to use google fonts but load them locally, which will remove the slower google font API, then follow this guide: