• Resolved alfredino

    (@alfredino)


    Hi,
    I am using wordpress 6.0.1 with the twenty fourteen theme and several plugins including elementor 3.7.0 and child theme configurator.
    I need to disable google fonts as their use is not GDPR compliant. I have tried several solutions, with a plugin and manual https://fontsplugin.com/disable-google-fonts/, but the fonts are still loaded.
    In addition, I have tried disabling all plugins, but have not been able to solve the problem. According to the documentation of elementor https://elementor.com/help/speed-up-a-slow-site/ I should just add this
    you need to deactivate and add_filter( ‘elementor/frontend/print_google_fonts’, ‘__return_false’ );

    This is the theme function inside functions.php
    function twentyfourteen_font_url() {
    $font_url = ”;
    /*
    * translators: If there are characters in your language that are not supported
    * by Lato, translate this to ‘off’. Do not translate into your own language.
    */
    if ( ‘off’ !== _x( ‘on’, ‘Lato font: on or off’, ‘twentyfourteen’ ) ) {
    $query_args = array(
    ‘family’ => urlencode( ‘Side:300,400,700,900,300italic,400italic,700italic’ )
    ‘subset’ => urlencode( ‘latin,latin-ext’ ),
    ‘display’ => urlencode( ‘fallback’ ),
    );
    $font_url = add_query_arg( $query_args, ‘https://fonts.googleapis.com/css’ );
    }

    return $font_url;
    }

    What can I do?
    Thank you

Viewing 1 replies (of 1 total)
  • Thread Starter alfredino

    (@alfredino)

    Hi,
    after further analysis, I have found that the following code works well to block google fonts on the twenty-four theme plus elementor plugin.

    // Remove lato font
    function theme_dequeue_fonts() {
    	wp_dequeue_style( 'twentyfourteen-lato' );
    }
    add_action( 'wp_enqueue_scripts', 'theme_dequeue_fonts', 20 );
    
    // Remove elementor google fonts
    add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );
Viewing 1 replies (of 1 total)
  • The topic ‘Remove google fonts’ is closed to new replies.