Before you start the process of synchronizing your Shopify store with Plytix, it is better to know the basics. What is […]
By AayushGoogle Fonts is a very innovative feature of WordPress, and every WordPress website uses Google Font Kit to enhance the legibility of its sites. Nevertheless, it can occasionally become irksome. The following are a few potential causes: Rendering a website is a long process. The website sometimes fails. It automatically starts this website and takes a very long time to show. It can be frustrating, particularly when developing a website on a local host.
WordPress is a very popular and flexible CMS suitable for quickly creating your website or blogging. With its vast collection of themes, more than fifty thousand extensions, and various functions that can be used to build visually appealing websites, it’s considered a good choice for both personal and commercial use. One of these is the opportunity to utilize Google Fonts, a complimentary method for using a myriad of fonts on your pages that will definitely draw in the site visitor’s focus and enhance the beauty of the text.
However, sometimes, you may need to disable Google Fonts for your WordPress site. It may be because of security or because this site takes too long to load. This article will present you with different ways to deactivate Google Fonts on your WordPress website.
Understanding Google Fonts
Google Typefaces is an online service that provides free typefaces for use in web resources. Most of these typefaces are pulled from Google’s servers, so you don’t need to include the font files on the website. Another benefit is that it saves you a lot of time because you don’t have to download the fonts on your website.
Why should you disable Google Fonts on your WordPress website?
The typography you choose for your WordPress website is crucial to its brand identity and design. That’s why many website owners use Google Fonts to customize their typography.
However, if too many fonts are loaded, WordPress’s efficacy will be diminished. That’s why we advise you to choose only two typefaces and use them throughout your website.
On the other hand, you can disable Google typefaces and use the built-in system typefaces that have already been preinstalled on the user’s computer. They load much quicker, especially for users with a slow connection, and look superb.
As such, we decided to disable Google Fonts when we redesign the WPBeginner website. Our goal was to make learning and growing one’s online presence easy, even if you have a bad internet connection.
Not disabling Google Fonts is not the best option for all blogs or business websites. Disabling Google Fonts can improve the user experience for visitors from areas with poor internet speed.
Furthermore, Google Fonts also has privacy concerns that may make your website noncompliant with regulations like GDPR. Disabling Google Fonts reduces the likelihood that your website violates any international privacy laws.
However, let us now look at how to disable Google Fonts in WordPress.
Deleting Google Fonts
The easiest solution is likely to delete the Google Fonts you have installed, which means you’ll need to change settings in the WordPress Customizer. You can disable Google Fonts for your WordPress website using the WordPress Customizer. It’s a built-in application that lets you change a number of parameters and see what will be changed in the appearance of your website without affecting the live site.
Step 1: Go to the WordPress back panel and click “Appearance” from the left navigation pane.
Step 2: From the “Themes” drop-down menu, select the term “Customize.”
Step 3: Go to the bottom of the current active theme and click on “Appearance” then “Customizer.” In the left-hand side pane, click on the “Additional CSS” option. If you don’t see this option, you may have to expand it by clicking the ‘See All Customizer Settings’ button in the lower part of your sidebar.
Step 4: Since the font specific is specified in the href attribute, they will be disabled. To prevent one font specifically, replace “YourFontName” with the name of the Google Font you wish to disable. In all caps, you must provide them with the entire font name, including possible variations. For example, “Roboto:100,100i, 300,300i, 400,400i, 500,500i, 700,700i, 900,900i.”
Step 5: Once you click the “Publish” button, it will save and validate your changes. This should remove the Google Font from your website that you want to remove.
Removing Google Fonts from a WordPress Theme without a Plugin
Adding custom code to your website may seem daunting, but it’s pretty simple. Go to the WordPress admin dashboard and choose “Appearance.” Under the Appearance tab, you’ll find your Theme Editor.
Before implementing any code, save a backup of your functions.php file so that you can revert to your previous file if necessary.
The functions.php file is a template file that uses PHP code to add or modify features to a WordPress site. To include the Google Fonts CSS stylesheet in their website, theme developers add the wp_enqueue_style() function in their functions.php file. All you need to do is add a specific WordPress function, wp_dequeue_style(), into your functions.php file.
This function can be used only when the $handle of the stylesheet is known. The identifier needs to inform us of the location of the unique stylesheet. Below is an illustration of disabling Google Fonts on the GenesisPress Theme. Eliminate Google Fonts from the 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 unique identity of the enqueued Google Fonts CSS stylesheet, or $handle, is genesis-sample-fonts. We have created a function called tn_dequeue_google_fonts_style that will use our wp_dequeue_style function and take the $handle of our ‘genesis-sample-fonts’.
Without the add_action function, your new function won’t be executed, as it won’t be connected to a specific action. We pass the name of our function, ‘tn_dequeue_google_fonts_style’, to the wp_print_styles function so that the function runs.
Eliminating Google Fonts from WordPress using a plugin
It’s easy to disable the installation of Google Fonts in WordPress using a plugin. The method is as follows.
Methods for Eliminating Google Fonts from WordPress:
- Download the “Disable and Remove Google Fonts” plugin and activate it.
- The plugin works immediately. This stops Google Fonts from being downloaded automatically on your WordPress site.
- And you are finished! Google Fonts should not be displayed on your WordPress site anymore.