[Resolved] Change from loading fonts from fonts.googleapis.com to lokal

  • Author
    Posts
  • #17077

    S-Kopp
    Participant

    Hello,
    I can’t find where to remove font loading from fonts.googleapi.com.
    Even though I’ve embedded the fonts locally, the fonts are still loaded via fonts.googleapi.com.
    The problem is that in Germany this must not happen before the user gives their consent. There are currently masses of warnings due to the violation of the Data Protection Act

    #17083

    Andrew Misplon
    Keymaster

    Hi, thanks for reaching out.

    I’ll need to introduce filters in the future to accommodate GDPR concerning Google Fonts. For now, you could perhaps use https://wordpress.org/plugins/host-webfonts-local/. I’ve tested it, and it seems to work as required:

    https://purothemes.com/wp-content/uploads/2022/10/OMGF_‹_Polestar_—_WordPress-scaled.jpg

    Don’t load must be manually selected in the plugin options page.

    #17087

    Andrew Misplon
    Keymaster

    Hi again. The screenshot I posted previously was for Polestar. Please, see the screenshot below for Ultra:

    https://purothemes.com/wp-content/uploads/2022/10/ultra-fonts-scaled.jpg

    Thanks

    Andrew

    #17091

    Wegkreuz
    Participant

    Hi,

    I tried the Plugins OMGF (as proposed) and Local Google Fonts.
    For some cases it works, i.e. fonts are loaded from the local server.
    However, if I open the developer console in Google Chrome, there is a connection to fonts.gstatic.com.
    I my case, dyncamic css seems to be produces by the theme. As Initiator there is an entry with “css?family=Cuprum:400|Cuprum:700&display=block” and the URL “https://fonts.googleapis.com/css?family=Cuprum:400|Cuprum:700&display=block”

    Perhaps, the File: \wp-content\themes\ultra\inc\customizer\customizer.php, Line 86 and other is the problem:
    /**
    * Echo all the CSS
    */
    function css() {
    // Start by importing Google web fonts
    $return = ‘<style type=”text/css” id=”customizer-css”>’;
    ….
    $return .= ‘@import url(//fonts.googleapis.com/css?family=’ . implode( ‘|’, $import ) . ‘&display=block); ‘;

    How can we fix the problem urgently?

    Is it possible to modify the file so that it refers to a local URL?

    #17110

    knupp
    Participant

    Hello Andrew,
    I am having the exact same issue. I have tried to get the fonts with a plugin called “Local google fonts”, and I have tried OMGF as well as you recommended, I have also browsed every site in order to load everything but both plugins aren’t able to find all font loadings from google on this website, while a random google-fonts-checker immediately does.
    How can I pinpoint which elements are using the google-loaded fonts, and change the source?

    The site I need help with is on http://www.wilde-saiten.de.
    Thank you for your help!
    Sonja

    #17120

    Andrew Misplon
    Keymaster

    Hi Sonja

    I’ve replied to the thread you opened. Thanks.

    #17126

    Andrew Misplon
    Keymaster

    Hi Wegkreuz

    Apologies for the delay. If you can perhaps open a new support thread, I’d be happy to lend a hand.

    Thanks

    Andrew

    #17138

    Andrew Misplon
    Keymaster

    The following can be tried in Code Snippets set to load on the site front-end:

    function ultra_child_setup() {
    	if ( function_exists( 'siteorigin_webfonts_remove_font' ) ) {
    		siteorigin_webfonts_remove_font( 'Muli' );
    		siteorigin_webfonts_remove_font( 'Lato' );
    	}
    	add_filter( 'ultra_import_google_fonts', '__return_false' );
    }
    add_action( 'after_setup_theme', 'ultra_child_setup', 30 );

    Thanks.

    #17140

    Andrew Misplon
    Keymaster

    I’ve updated the above function to avoid an error when switching themes. Thanks.

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Change from loading fonts from fonts.googleapis.com to lokal’ is closed to new replies.

Scroll to top