Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello screen-b.

    I don’t see why GDPR would affect the usage of Google Fonts on a website.
    I remember the panic that ensued after the announcement of that law but when the dust settled I don’t remember seeing anyone who actually had to disable them.

    You can read through, for instance – https://github.com/google/fonts/issues/1495 and there are many more articles to waste your time on, but they all originate from the first part of 2018.

    Thread Starter screen-b

    (@screen-b)

    Thanks for your replay.

    I already installed other fonts via child theme.
    I do not not need the meta link to Google fonts.
    How can I delete it?

    Regards
    Jutta

    Hello @screen-b,

    Hope you are having a great day!

    There’s no option on the theme to deregister Google fonts, so the way to do what you need is editing one file.

    Go to the function.php file and comment or delete the line 146,

    wp_enqueue_style( 'kale-fonts', kale_fonts_url(), array(), null );

    That will remove the font call and it’s fast to implement, but you’ll lose this change when you update your theme. So the right way to go is creating a child theme and deregister the call from there using:

    function kale_dequeue_unnecessary_styles() {
        wp_dequeue_style( 'kale-fonts' );
        wp_deregister_style( 'kale-fonts' );
    }
    add_action( 'init', 'kale_dequeue_unnecessary_styles' );

    ?Try it and let me know how it worked.
    Kind regards,
    Diego

    Thread Starter screen-b

    (@screen-b)

    Hi Diego,
    Unfortunately – no, it did not work.
    Best regards
    Jutta

    Hi @screen-b,

    Could you please paste here the code from child theme’s functions.php file that you’ve created?

    Thanks
    Diego

    Thread Starter screen-b

    (@screen-b)

    Hi, Diego,

    I added the code you suggested:

    add_action( 'wp_enqueue_scripts', 'child_theme_styles' );
    
    function kale_dequeue_unnecessary_styles() {
        wp_dequeue_style( 'kale-fonts' );
        wp_deregister_style( 'kale-fonts' );
    }
    add_action( 'init', 'kale_dequeue_unnecessary_styles' );

    In total:

    <?php
    /**
    * Child theme stylesheet einbinden in Abh?ngigkeit vom Original-Stylesheet
    */
    
    function child_theme_styles() {
    wp_enqueue_style( 'kale', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'mk_kale', get_stylesheet_directory_uri() .'/style.css' , array('parent-style'));
    
    }
    add_action( 'wp_enqueue_scripts', 'child_theme_styles' );
    
    function kale_dequeue_unnecessary_styles() {
        wp_dequeue_style( 'kale-fonts' );
        wp_deregister_style( 'kale-fonts' );
    }
    add_action( 'init', 'kale_dequeue_unnecessary_styles' );
    
    ?>

    Thanks
    Jutta

    Hi @screen-b,

    Could you share your URL so we can see this first hand?
    Thanks.

    Thread Starter screen-b

    (@screen-b)

    Sorry, the site is not yet open to the public.
    Can I send a personal message?

    @screen-b, absolutely!
    Please contact me at https://www.lyrathemes.com/support/

    All the best,
    Diego

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to disable connection to Google Fonts servers’ is closed to new replies.