This post is focused on the solution to Remove Google Fonts from WordPress Theme. Nowadays, most of the WordPress themes comes pre-installed with Google Fonts or Google Web Fonts. You can remove google fonts from a website with or without using WordPress plugin.
Table of Contents
Why Remove Google Fonts from WordPress Theme
Google Fonts looks great and give your website a unique and modern look. And at the same time, you also compromised with website performance.
I have removed Google Fonts from my website and using Web Safe Fonts without compromising the look and feel of my website. Which resulted in increased website loading speed and good performance.
How to Remove Google Fonts from WordPress Theme
Now, let’s discuss how you can Remove Google Fonts from WordPress theme. You can remove google fonts from the website by adding a piece of code into your theme files.
Theme developers add Google Fonts CSS stylesheet using WordPress Function wp_enqueue_style()
in the functions.php
file of your WP theme. This WP Function is intended to register any CSS stylesheet via provided source and enqueues the same.
Remove Google Fonts from WordPress Theme – Without Plugin
It is quite simple, you only need to add a specific WordPress Function wp_dequeue_style()
into functions.php
file of your WordPress theme. This WP Function is used to remove a previously enqueued CSS stylesheet. I have tried to unfold the uses in following steps.
Before that we need to understand how this WP Function wp_dequeue_style()
works and its requirements.
- WordPress Function –
wp_dequeue_style( string $handle )
- Description – Remove a previously enqueued CSS stylesheet.
- Parameters –
$handle
│ It is mandatory. A unique name of the enqueued CSS stylesheet.
Following code need to be added in the functions.php
file.
Remove Google Fonts from Genesis Sample WordPress Theme.
//* TN Dequeue Styles - Remove Google Fonts from Genesis Sample WordPress Theme add_action( 'wp_print_styles', 'tn_dequeue_google_fonts_style' ); function tn_dequeue_google_fonts_style() { wp_dequeue_style( 'genesis-sample-fonts' ); }
The $handle
or the unique name of enqueued CSS stylesheet for Google fonts in Genesis Sample WordPress Theme is genesis-sample-fonts.
This code will work with every WordPress them in which Google Fonts enqueued via WordPress function. You only need to identify and replace this unique name/$handle with your stylesheet $handle
. And add this code in the functions.php
file of your WordPress theme. Try to search your functions.php file with Keyword ‘fonts’
or ‘google’
.
Don’t forget to take a backup of your functions.php file, will be useful in case of any miss happening.
Remove Google Fonts from Divi theme by Elegant Themes
//* TN Dequeue Styles - Remove Google Fonts from Divi Theme add_action( 'wp_print_styles', 'tn_dequeue_divi_fonts_style' ); function tn_dequeue_divi_fonts_style() { wp_dequeue_style( ‘divi-fonts' ); }
Cheat Sheet to identify Google Font Stylesheet name or $handle of popular WordPress Themes
Theme | Google Fonts Stylesheet Name / $handle |
Twenty Twelve | twentytwelve-fonts |
Twenty Thirteen | twentythirteen-fonts |
Twenty Fourteen | twentyfourteen-fonts |
Twenty Fifteen | twentyfifteen-fonts |
Twenty Sixteen | twentysixteen-fonts |
Twenty Seventeen | twentyseventeen-fonts |
Genesis Sample | genesis-sample-fonts |
Extra | extra-fonts |
Divi | divi-fonts |
Remove Google Fonts from WordPress Theme – With Plugin
There are several plugins available on WordPress repository to remove Google Fonts specifically. You only need to install and activate following WordPress plugins.
- Disable Google Fonts – It is a very basic WordPress, which is light in weight. There is no setting. You just need to activate it and it works immediately. This plugin works well with bundled WordPress themes e. Twenty Twelve, Twenty Thirteen, Twenty Fourteen, Twenty Fifteen, Twenty Sixteen, Twenty Seventeen.
- Remove Google Fonts References – This is also a good plugin. It stops loading Google Fonts in WordPress theme. No settings are there, it started working automatically after installation and activation.
Wrapping Up
I do not recommend shared web hosting users to use Google Fonts on their website. As it impacts your website speed badly.
What fonts do you use, Google Fonts or Web Safe Fonts? Does using Google Fonts impact your website performance?
Let us know if you want to Remove Google Fonts from any other WordPress theme.
You might like:
How to Remove Dashicons from Genesis Theme
Remove Font Awesome from WordPress Theme