Remove Google Fonts from WordPress Theme

Updated on

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.

Remove Google Fonts from WordPress Theme
Remove Google Fonts from WordPress Theme

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 Functionwp_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

Photo of author
Saurabh K
Saurabh K is a technology enthusiast and part-time blogger. He loves to explore the efficient use of technology and gadgets. He is an outlier and lensman. Add him in your social circle to know more.
Disclaimer: Affiliate links of some product(s) are being used on this page, if you follow the link and make a purchase, we may receive compensation from respective companies. This compensation comes at no additional cost to you.

33 thoughts on “Remove Google Fonts from WordPress Theme”

  1. Avatar of Heike

    Thank you so much – easy & perfect solution!

    Best regards
    Heike

    Reply
  2. Avatar of Joerg

    Hi, at my Divi Child Theme this did not work.

    Reply
    • Hi Joerg,
      Thank you for pointing out. You should use the correct stylesheet $handle to remove google fonts from Divi theme. In the latest version of Divi theme, they changed the stylesheet $handle.
      Try using divi-fonts-css instead of divi-fonts. It will work.

      Reply
  3. Avatar of raju

    Is is possible to remove Google fonts from Elemin theme of Themify family. Please let me know.
    Thanks

    Reply
    • Yes. Just try to use the right $handle.

      Reply
  4. Avatar of F.U.T.Z.

    I have build a divi child theme and add to functions.php the script:
    //* TN Dequeue Styles – Remove Google Fonts from Divi Theme
    add_action( ‘wp_print_styles’, ‘tn_dequeue_divi_fonts_style’ );
    add_action( ‘wp_enqueue_scripts’, ‘tn_dequeue_divi_fonts_style’ );
    function tn_dequeue_divi_fonts_style() {
    wp_dequeue_style( ‘divi-fonts-css’ );
    wp_dequeue_style( ‘divi-fonts’ );
    }

    but it will not working with divi-fonts-css or divi-fonts. My Divi version is 3.0.5

    Reply
    • In that case, you have to use the web safe font from the customize panel and then use this code to remove google font.

      Reply
  5. Avatar of Marvin

    Hi! I am using the Accesspress parallax pro Themen and IT doesn’t work. :(( Do you have an Idea?

    Reply
    • You should have use this (google-fonts-css) $handle to make it work.

      Reply
  6. Avatar of Sam Khand

    any idea what font handle does bridge theme uses?

    Reply
    • use the plugin, if you are not able to identify the $handle

      Reply
  7. Avatar of David

    Good evening, I write from Spain the article is very interesting, and I was wondering if you can help me … my topic is Salient, what function do I have to place in the file functions.php

    Greetings and I’m waiting.

    Reply
  8. Avatar of webmaster

    if ( ! function_exists( ‘hoffman_load_style’ ) ) {

    function hoffman_load_style() {
    if ( ! is_admin() ) {
    wp_register_style( ‘hoffman_googleFonts’, ‘//fonts.googleapis.com/css?family=Raleway:400,600,700,800|Vollkorn:400,400italic,700,700italic’ );
    wp_register_style( ‘hoffman_genericons’, get_template_directory_uri() . ‘/genericons/genericons.css’ );
    wp_enqueue_style( ‘hoffman_style’, get_stylesheet_uri(), array( ‘hoffman_googleFonts’, ‘hoffman_genericons’ ) );
    }
    }
    add_action( ‘wp_print_styles’, ‘hoffman_load_style’ );

    what do i do to stop calling google fonts without losing all other formatting?

    Reply
    • You can comment out the Goggle fonts line from your code.
      /* wp_register_style( ‘hoffman_googleFonts’, ‘//fonts.googleapis.com/css?family=Raleway:400,600,700,800|Vollkorn:400,400italic,700,700italic’ ); */
      This should work.

      Reply
  9. Avatar of Kyle

    Hey there great post, do you happen to know what the $handle is for the AVADA theme? I’m thinking it may be Avada_Fonts or Avada_gfonts??
    Thanks for your help.

    Reply
    • Hi, The default font of AVADA theme is museo-slab and PT-sans. museo-slab is not a Google font so, these fonts should have to removed/changed from the style.css/function.php file. If you are not comfortable in editing theme files Try using the plugin to remove google font.
      Cheers!

      Reply
  10. Avatar of Juan Hazanow

    Interesante. Gracias.

    Reply
  11. Avatar of Seb

    Hey,

    It doesn’t work for me. I have Wealth theme.
    I added this :
    add_action( ‘wp_print_styles’, ‘tn_dequeue_google_fonts_style’ );
    function tn_dequeue_google_fonts_style() {
    wp_dequeue_style( ‘wealth-fonts’ );
    }
    and when I open my site, it seems like it works for some milliseconds and then some scripts allow the google fonts again :O

    Reply
    • Avatar of Saurabh K

      Hey Seb,
      Thank you for the response. After removing the font, test your site in an incognito window, it should work.
      Otherwise, you must remove the code from the theme file, or use the plugin.

      Reply
  12. Avatar of Eliza

    thank you so much. finally a solution that worked, after trying for hours! thanks!!

    Reply
  13. Avatar of Danil

    Does not work on AccessPress Lite.

    Reply
    • Avatar of Saurabh K

      Hey Danil, I am not sure which $handle you are using to remove the google font. However, to make it work with AccessPress Lite, you should use accesspresslite-google-fonts

      Reply
  14. Avatar of TVP Blog

    My website using Xmag Them, but I don’t find the theme Google fonts. Please help me! Thanks

    Reply
    • Avatar of Saurabh K

      In that case, you should use a plugin to remove google font.

      Reply
  15. Avatar of TVP Blog

    hi!
    My website used xmag theme. And I have removed Google fonts by code:
    /* TN Dequeue Styles – Remove Google Fonts from Xmag Theme
    add_action( ‘wp_print_styles’, ‘tn_dequeue_xmag_fonts_style’ );
    function tn_dequeue_xmag_fonts_style() {
    wp_dequeue_style( ‘xmag-fonts’ );
    }
    When I use PageSpeed Insights check, the google fonts still load.
    Please help me!

    Reply
    • Avatar of Saurabh K

      It should work if you are using the $handel right? Otherwise, you should use a plugin.

      Reply
  16. Avatar of Fiveingreen

    Thanks for your post, Saurabh. You are right: G. fonts can impact the performance of our websites pretty badly, and not only on shared hosting…

    I have a (probably stupid 🙂 ) question, though: why not delete or comment out the wp_enqueue_style() in functions.php and replace the font(s) in the stylesheet? I don’t understand this enqueue then dequeue process.

    That’s what I’ve done with Genesis Sample and it’s working just fine, unless I’m missing something…

    Reply
    • Avatar of Saurabh K

      Hey, there is no harm in deleting and commenting out the wp_enqueue_style() from your theme. It will work fine.
      The dequeuing function works, when you did not (wanted to) know/or unable to found font enqueue function in your theme. ?

      Reply
      • Avatar of Fiveingreen

        😀 😀 😀

        Anyone who cannot find and comment out this piece of code is unable to understand your post. (which doesn’t mean (s)he is stupid, don’t get me wrong)

        Reply
  17. Avatar of poul

    google analytics and google fonts fu**ked my site speed
    very thanks for this help

    Reply
  18. Avatar of lavanya

    Hi, I have an doubt that, removing of google fonts will not affect our front-end pages right?

    Reply
    • Avatar of Saurabh K

      Hi Lavanya,
      Removing the google font may affect the front end of your website. It totally depends on the avilability of the fallback fonts.

      Reply
  19. Avatar of Trijit

    Really an amazing article. However, I’m using oceanWP theme. There is a option in customize>typography>general to disable the Google font. I disabled it and it looks ugly now. Is there any way to remove Google font without compromising the look in oceanWP theme?

    Reply

Leave a Comment

Your email address and website details will not be published. Required fields are marked with *.