Site logo

[Resolved] Unwanted contact fonts.googleapis

Home Forums Support [Resolved] Unwanted contact fonts.googleapis

Home Forums Support Unwanted contact fonts.googleapis

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #2531147
    John David

    Hi there,

    I am using Generatepress premium and Generateblocks.
    I have installed a locally hosted font and customised my site to use it.
    However, my site still contacts googleapis – whether it actually downloads fonts there or not I don’t know. But I want to remove that contact.
    I see the following on my home page:
    <link rel=’dns-prefetch’ href=’//fonts.googleapis.com’ />
    and
    <link rel=’stylesheet’ id=’generateblocks-google-fonts-css’ href=’https://fonts.googleapis.com/css&#8217; media=’all’ />
    I assume one is created by Gpress and the other by Gblocks.

    I have read and tried everything I can find, and nothing seems to help.
    For example, I have placed this in a code snipet:
    add_action( ‘wp_enqueue_scripts’, function() {
    wp_dequeue_style( ‘generate-fonts’ );
    } );
    add_action( ‘admin_init’, function() {
    add_filter( ‘generate_google_fonts_array’, ‘__return_empty_array’ );
    } );
    To no effect.

    I read in Generateblocks that there is a simple switch (https://docs.generateblocks.com/article/typography-overview/), but it does not show on my site.
    None of the advice I can find seems to apply.

    Please can you tell me what to do?

    #2531232
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to your site where i can look to see which GenerateBlocks element has a google font applied to it.

    #2531276
    John David
    #2531280
    John David
    #2531282
    John David

    Another typo – what’s happening?

    https://halifax-translation.com

    #2531295
    David
    Staff
    Customer Support

    🙂
    Is there a specific page or post where the request is being made ?

    #2532817
    John David

    I checked these instances of contacting googleapis on my home page, but it’s the same on all pages.

    I checked the waterfall, funny, it has this close to the top:
    css (canceled) fonts.googleapis.com 0 78ms
    open-sans-v18-latin-regular.woff2 (canceled) halifax-translation.com 0 333ms
    open-sans-v18-latin-600.woff2 (canceled) halifax-translation.com 0 362ms
    open-sans-v18-latin-italic.woff2 (canceled) halifax-translation.com 0 401ms
    open-sans-v18-latin-600italic.woff2 (canceled) halifax-translation.com 0 441ms

    Then, almost as the last item, it proceeds to load the fonts from our site.

    Can there be an issue with using ‘font-display: swap;’ in the @font-face declarations?

    #2532929
    David
    Staff
    Customer Support

    Ah ok, it didn’t show before, maybe a cache thing.

    Looking at the GB CSS.
    I see 4 instances of where a font has been selected in the block editor.
    And they are all buttons, the Get a Quote, Mail Us, Call Us and other Get a Quote.

    Can you check to see if any of those have the Google font selected ?

    #2533133
    John David

    D’oh! (as Homer Simpson says).

    That’s where the Gblocks Googleapis option is!

    This seems to be the solution. Many thanks!

    #2533149
    John David

    An interesting point for anyone with the same problem:
    Where I have a stack of a few cells, when I work down switching off the “Use Googleapis font” toggle, the third one in each stack re-sets itself to “on” as I go further down. I have to check them again. When I switch it off for a second time, it stays off.

    Thanks again for your patience!

    #2533154
    John David

    Oh, and one more thing:
    Where I have a single button, there is no Googleapis font toggle to be seen (this is why I dd not understand the advice I previously found on this forum). It’s only where I have a stack that the toggle is visible in each cell.

    #2533171
    David
    Staff
    Customer Support

    Glad to hear you got it resolved.
    We will be improving the way GB handles google fonts in the future, including a filter to disable the API completely.

    🙂

    #2533833
    John David

    Great.
    Thanks once more for excellent support.

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