Site logo

[Resolved] How to disable Google fonts or update enqueing process

Home Forums Support [Resolved] How to disable Google fonts or update enqueing process

Home Forums Support How to disable Google fonts or update enqueing process

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #257243
    Gary

    Hi Tom, I found bits and pieces of answers here could not formulate a complete understanding. I’m going to try hosting Google fonts on a CDN. Can you tell me how I can prevent loading them twice? Thanks very much.

    Gary

    #257386
    Tom
    Lead Developer
    Lead Developer

    You can remove them from GP like this:

    add_action( 'wp_enqueue_scripts','tu_remove_google_fonts', 10 );
    function tu_remove_google_fonts() {
        wp_dequeue_style( 'generate-fonts' );
    }

    Then you’ll need to enqueue your self hosted version 🙂

    #445952
    ferrutia

    Hi Tom, I’m using Catamaran font and not all variants.
    I think to remove the fonts because I’m not using more. How can I do it and later use only the font that I need?
    In PageSpeed show me this:
    http://fonts.googleapis.com/…lar,500,600,700,800,900|Playball:regular
    https://fonts.googleapis.com/…00,700italic,800,800italic,900,900italic
    both are CSS resources that cause a block. This causes a delay in the processing of the page.
    Thanks for your help!
    Fernando

    #446022
    Tom
    Lead Developer
    Lead Developer

    You can remove the Google fonts you’re using in “Customize > Typography”. Once those values are set to something non-Google, you won’t have the calls to those resources.

    #446092
    ferrutia

    Hi Tom again. Thanks for your fast answer.
    I did all you recommend me. But I don’t understand why now I see block the CSS Catamaran font (I changed for Playball because before was my mistake and I’m using Catamaran now) and still Italic cause a block:
    http://fonts.googleapis.com/css?family=Catamaran:200,regular,600
    https://fonts.googleapis.com/…00,700italic,800,800italic,900,900italic (this is Catamaran but don’t see all the line and are all the variants and also the italic variant but I don’t see in the customize typography to remove)
    Can I send you some screenshots and you can see what I mean?
    Because in PageSpeed in computer is 90/100 but in mobile is 74/100.
    In Pingdom is 95 in 771ms
    In GTMetrix is 90 PS and 78 Yslow Score
    I need to fix something more, but the fonts are part of the problem with the CSS.
    Thanks again for your help.
    Fernando

    #446538
    Tom
    Lead Developer
    Lead Developer

    If you use a Google font, it will cause a render blocking resource. You would avoid that by adding it to the footer, but that will cause a flash of unstyled font when the user visits your site.

    This is usually a warning to ignore, especially if your site is fast anyways.

    #446802
    ferrutia

    Yes i think I need to move on, but my worries is about the mobile devices speed that is not fast yet, and maybe if I improve this issue it will be better.
    Thanks again Tom for your answer and help.
    Cheers
    Fernando

    #447077
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

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