Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1065466

    I’ve put my Google Fonts locally and want to disable the external Google Fonts requests to speed up my website. I’ve looked in the Enfold settings, but can’t find an option to disable that. Is this possible and how?

    Thanks.

    Mark

    #1065495

    and you have truely activated the fonts localy?

    so here is the code to hamper loading of Google Fonts from google in Enfold
    it comes to your child-theme functions.php:

    add_action( 'init', 'enfold_customization_switch_fonts' );
    function enfold_customization_switch_fonts() {
        global $avia;
        $avia->style->print_extra_output = false;
    }

    by the way – this little plugin i got additionally loaded: remove-google-fonts-references
    Allthough it is not tested for new WordPress- on my end i can say that it works for WP 5.0.3.

    #1065504

    Just because you prevent Google Fonts from loading themes Internally from Google Servers doesn’t mean you can’t still use the stuff in the Enfold settings.

    If your fonts are in the Enfold list – you can choose them and use them – only the loading via Google Servers are hampered by this code above.
    If you have installed new fonts, you can reintegrate them according to the known method.
    f.e:

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Source Sans Pro'] = 'Source Sans Pro:300,300i,400,400i,700,700i';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Source Sans Pro'] = 'Source Sans Pro:300,300i,400,400i,700,700i';
    return $fonts;
    }
    #1065533

    Thank you Guenni007,
    I use the plugin CAOS for Webfonts where you download specified fonts (that you use on your website) locally and it creates a stylesheet for them. If I’m going to use new fonts later on, I also download them via the CAOS plugin and then it will generate a new stylesheet.

    The instructions state that the next step is to remove external Google Fonts references.

    So I guess I can either use the (outdated) plugin you suggested or paste the first code in functions.php.

    If the plugin was still maintained I for sure would’ve picked the plugin option.

    Mark

    #1065560

    Try first the code above. But it only removes the enfold support for loading google fonts form Google Servers.
    But there are a lot of Google Font GDPR conflicts – f.e. on loading a google map the Roboto Font is always loaded. So it might be good to totaly refuse Goolge Server loading

    #1065600

    Your code works :-)
    I saw also WP plugins that even take care of fonts used in plugins. Maybe they also take Google Maps into account?

    For now, I’m satisfied.

    Mark

    #1066131

    Hi,

    Thank you for letting us know – we appreciate it a lot.

    Best regards,
    Basilis

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘How to remove external Google Fonts requests?’ is closed to new replies.