Site logo

[Support request] Removing Google Fonts from child theme

Home Forums Support [Support request] Removing Google Fonts from child theme

Home Forums Support Removing Google Fonts from child theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2290103
    Christian

    Hi,

    I have a site (see private info section) that’s on Ezoic ads. They’re saying I should disable Google Fonts API.

    They sent me their support article here: https://wordpress.ezoic.com/how-to-remove-google-fonts-from-your-wordpress-site/. Under the “Custom Child Themes Available for Download without Google Fonts” section, they want me to download certain Google Fonts child theme. However, I set up a child theme already a few days back.

    I added the code in the first block in this article: https://docs.generatepress.com/article/remove-google-fonts/ to my child’s theme function PHP file.

    However, when I check gtmetrix Google fonts is still present.

    Can you please help me remove google fonts from the way I have my current child theme?

    #2290115
    Fernando
    Customer Support

    Hi Christian,

    Where did you add the code? Can you try this code instead?:

    add_action( 'wp_enqueue_scripts', function() {
        wp_dequeue_style( 'generate-google-fonts' );
    },99 );

    Moreover, by default, if you don’t use Google Fonts anywhere in your site, it shouldn’t be loaded.

    Are you loading it in the typography module? Can you toggle it off there?

    Moreover, if you’re using GenerateBlocks, and using Google fonts in any of the blocks, kindly remove it from there as well.

    Hope this clarifies!

    #2290595
    Christian

    Hi Fernando,

    Thanks for that code.

    I added it to my GP Child Theme Functions.php file.

    I checked the typography module, and it’s not on. This is what I see: https://prnt.sc/vM896okYGKHa

    Can you confirm that Google fonts are not loading on my site now that I have the new code installed?

    #2290601
    David
    Staff
    Customer Support

    Hi there,

    i do not see any Google Font requests being made on your site.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.