Disable Google Fonts - by Royalty - on WordPress WooCommerce support

This topic has 4 replies, 2 voices, and was last updated 9 years, 10 months ago ago by Eva Kemp

  • Avatar: Royalty
    Royalty
    Participant
    January 26, 2016 at 13:42

    Hello,
    I would like to disable the google fonts Open Sans and Roboto because I dont need them and their loading is slowing down my site. I found the following code in theme.php, line 16:

    if(!function_exists('et_enqueue_gfonts')) {
        function et_enqueue_gfonts() {
            wp_enqueue_style("font-open-sans",et_http()."fonts.googleapis.com/css?family=Open+Sans:300,400,700,300italic");
            wp_enqueue_style("font-roboto",et_http()."fonts.googleapis.com/css?family=Roboto:100,400,500,700,300&subset=latin,cyrillic-ext");
        }
    }
    
    add_action( 'wp_enqueue_scripts', 'et_enqueue_gfonts', 40);

    I tried to put
    remove_action( 'wp_enqueue_scripts', 'et_enqueue_gfonts', 40);
    and this had no effect. It worked by deleting the mentioned code in theme.php but I would prefer a method via functions.php.
    Any suggestions?
    Many thanks in advance!

    3 Answers
    Avatar: Eva
    Eva Kemp
    Participant
    January 28, 2016 at 09:41

    Hello,

    Please provide us with correct wp-admin panel and FTP credentials in Private Content.

    Regards,
    Eva Kemp.

    Avatar: Royalty
    Royalty
    Participant
    January 29, 2016 at 19:58

    Solved this already a few days ago. Adding the following code to functions.php did the trick:

    function custom_remove_styles() {
    global $wp_styles;
    wp_dequeue_style('font-roboto');
    wp_dequeue_style('font-open-sans');
    }
    add_action( 'wp_enqueue_scripts', 'custom_remove_styles' ,131);
    Avatar: Eva
    Eva Kemp
    Participant
    January 30, 2016 at 10:10

    Hello,

    Glad to hear it.

    Have a nice day.

    Regards,
    Eva Kemp.

  • Viewing 4 results - 1 through 4 (of 4 total)

The issue related to '‘Disable Google Fonts’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.