Site logo

Archived topic

Google Fonts still loading

7 replies · Started by Dominik on August 17, 2022

Viewing posts 1–8 of 8

Hi. I have following problem on my website. Although I have disabled all Google fonts (from Google API), the Lato font is still loading from Google API. However, I cannot find out why.

But when I disable the GP Premium plugin, the Google Font is gone. I have checked everything in both the Customizer and Global Styles, but cannot find the error.

Hi there,

i can see a preload link in the <head> of your site for the Lato font. GP doesn't do that by default. Most optimization plugins do.
But... because disabling GP Premium would disable the Elements module, have a look in Appearance > Elements to see if you have anything in your Hooks that could be adding the font.

Hi David,

we only preload the fonts from our server within Elements.

<link rel="preload" href="/wp-content/themes/brandwerk/fonts/cormorant-garamond-v15-latin-300.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/brandwerk/fonts/cormorant-garamond-v15-latin-regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/brandwerk/fonts/lato-v23-latin-300.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/brandwerk/fonts/lato-v23-latin-300italic.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/brandwerk/fonts/lato-v23-latin-700.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/brandwerk/fonts/lato-v23-latin-italic.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/brandwerk/fonts/lato-v23-latin-regular.woff2" as="font" type="font/woff2" crossorigin>

When I deactivate that, nothing changes. But when I additionally deactivate WP-Rocket, there is only a stylesheet from Google API which is still loading:

<link rel="stylesheet" id="generateblocks-google-fonts-css" href="https://fonts.googleapis.com/css?family=Lato:100,100italic,300,300italic,regular,italic,700,700italic,900,900italic&display=swap" media="all">

OK, so its being loaded by GenerateBlocks.... which means the google font was selected on a GB Block in the editor.
If i view your home page ( with WP Rocket disabled ) i can see the GB Stylesheet:

/wp-content/uploads/generateblocks/style-29035.css

Searching there i find 3 x instances where Lato is selected.

This is coming from the Footer copyright text:

p.gb-headline-a6e1df1a {
    font-family: Lato, sans-serif;
    text-align: center;
    color: var(--grey);
}

And these two look like Global Styles:

.gb-button-wrapper .gb-button-primaer, .gb-button-wrapper .gb-button-primaer:visited {
    color: var(--black);
    font-family: Lato, sans-serif;
    font-size: 14px;
    font-weight: normal;
    padding: 10px 20px;
    border-radius: 0;
    margin-right: 0;
    margin-left: 0;
    border-style: solid;
    border-width: 1.5px;
    border-color: var(--black);
}

.gb-headline-h2-klein {
    font-family: Lato, sans-serif;
    color: var(--black);
    font-size: 40px;
    font-weight: 700;
    padding-bottom: 10px;
    margin-bottom: 0;
}

Edit those blocks and in the Typography settings make sure you uncheck Google font.

Great! That works well.
Is there a solution to disable Google fonts API global (in GP and GB?)

In the EU some lawyers have began to lawsuit for damages when google font is loaded over the api.

Thanks David. Looking forward to the function in GenerateBlocks :)

Its slated for GB 1.6 - so the next update it should be possible.

Glad to be of help

This archived topic is closed to new replies.