Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1089877
    lemag
    Participant

    Hello,

    We are having some page speed issues on our website http://gamerobo.visualpath.net/ and mostly can be solved by removing all google fonts. We have installed and customized dedicated page performance plugins but we still need to disable those google fonts. We have tried the solution mentioned in previous posts which all pointed out to this thread: https://community.theme.co/forums/topic/custom-fonts-slow-down-the-site/

    We need to remove the following fonts:

    http://fonts.googleapis.com/css?family=Lato:100,300,regular,700,900%7COpen+Sans:300%7CIndie+Flower:regular%7COswald:300,regular,700&subset=latin%2Clatin-ext
    http://fonts.googleapis.com/css?family=Open+Sans%3A300%2C400%2C600%2C700%2C800
    http://fonts.googleapis.com/css?family=Raleway%3A100%2C200%2C300%2C400%2C500%2C600%2C700%2C800%2C900
    http://fonts.googleapis.com/css?family=Droid+Serif%3A400%2C700
    https://fonts.googleapis.com/css?family=Bitter|Lato|Libre+Baskerville|Montserrat|Neuton|Open+Sans|Pacifico|Raleway|Roboto|Sacramento|Varela+Round|ABeeZee|Abel|Abril+Fatface|Alegreya+Sans|Alex+Brush|Alfa+Slab+One|Amarante|Amatic+SC|Amita|Architects+Daughter|Arizonia|Arvo|Average+Sans|Bad+Script|Berkshire+Swash|Bigshot+One|Bowlby+One|Cabin|Cabin+Condensed|Cabin+Sketch|Cherry+Cream+Soda|Codystar|Coming+Soon|Cookie|Cutive+Mono|Fjalla+One|Freckle+Face|Fredericka+the+Great|Gabriela|Grand+Hotel|Great+Vibes|Habibi|Happy+Monkey|Julius+Sans+One|Just+Another+Hand|Kaushan+Script|Lobster|Lobster+Two|Maven+Pro|Oregano|Plaster|Playball|Pontano+Sans|Quicksand|Roboto+Condensed|Roboto+Mono|Roboto+Slab|Tenor+Sans|Lato|Open%20Sans|Libre%20Baskerville|Montserrat|Neuton|Raleway|Roboto|Sacramento|Varela%20Round|Pacifico|Bitter

    Please let us know the steps necessary to remove all google fonts.

    Waiting for your reply.

    #1089907
    Thai
    Moderator

    Hi There,

    To remove all google fonts, please add the following code under functions.php file locates in child theme:

    add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    function my_deregister_styles() {
    	wp_deregister_style( 'x-google-fonts' );
    }

    Hope it helps 🙂

    #1089925
    lemag
    Participant

    Hi Thai,

    We have added the code you provided to our child theme functions.php but the fonts are still loaded in the source code. We have flushed the cache and tested it with gtmetrix and pingdom.

    https://gtmetrix.com/reports/gamerobo.visualpath.net/2BoPcJrc
    https://tools.pingdom.com/#!/bRHi6m/http://gamerobo.visualpath.net/

    Please let us know what we can do in order to completely remove those fonts.

    Thank you.

    #1089966
    Thai
    Moderator

    Hi There,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link login to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1089971
    lemag
    Participant
    This reply has been marked as private.
    #1090321
    Rad
    Moderator

    Hi there,

    Please add this code to your child theme’s functions.php

    function x_enqueue_site_styles() {
    
        //
        // Stack data.
        //
    
        $stack  = x_get_stack();
        $design = x_get_option( 'x_integrity_design' );
    
        if ( $stack == 'integrity' && $design == 'light' ) {
          $ext = '-light';
        } elseif ( $stack == 'integrity' && $design == 'dark' ) {
          $ext = '-dark';
        } else {
          $ext = '';
        }
    
        //
        // Register styles.
        //
    
        wp_register_style( 'x-stack', X_TEMPLATE_URL . '/framework/css/dist/site/stacks/' . $stack . $ext . '.css', NULL, X_VERSION, 'all' );
    
        //
        // Enqueue styles.
        //
    
        if ( is_child_theme() ) {
          $dep = ( apply_filters( 'x_enqueue_parent_stylesheet', false ) ) ? array( 'x-stack' ) : NULL;
          wp_enqueue_style( 'x-child', get_stylesheet_directory_uri() . '/style.css', $dep, X_VERSION, 'all' );
        } else {
          wp_enqueue_style( 'x-stack' );
        }
    
        if ( is_rtl() ) {
          wp_enqueue_style( 'x-rtl', X_TEMPLATE_URL . '/framework/css/dist/site/rtl/' . $stack . '.css', NULL, X_VERSION, 'all' );
        }
    
        if ( X_BBPRESS_IS_ACTIVE ) {
          if ( x_is_bbpress() ) {
            wp_deregister_style( 'buttons' );
          }
          wp_deregister_style( 'bbp-default' );
          wp_enqueue_style( 'x-bbpress', X_TEMPLATE_URL . '/framework/css/dist/site/bbpress/' . $stack . $ext . '.css', NULL, X_VERSION, 'all' );
        }
    
        if ( X_BUDDYPRESS_IS_ACTIVE ) {
          wp_deregister_style( 'bp-legacy-css' );
          wp_deregister_style( 'bp-admin-bar' );
          wp_enqueue_style( 'x-buddypress', X_TEMPLATE_URL . '/framework/css/dist/site/buddypress/' . $stack . $ext . '.css', NULL, X_VERSION, 'all' );
        }
    
        if ( X_WOOCOMMERCE_IS_ACTIVE ) {
          wp_deregister_style( 'woocommerce-layout' );
          wp_deregister_style( 'woocommerce-general' );
          wp_deregister_style( 'woocommerce-smallscreen' );
          wp_enqueue_style( 'x-woocommerce', X_TEMPLATE_URL . '/framework/css/dist/site/woocommerce/' . $stack . $ext . '.css', NULL, X_VERSION, 'all' );
        }
    
        if ( X_GRAVITY_FORMS_IS_ACTIVE ) {
          wp_enqueue_style( 'x-gravity-forms', X_TEMPLATE_URL . '/framework/css/dist/site/gravity_forms/' . $stack . $ext . '.css', NULL, X_VERSION, 'all' );
        }
    
        if ( X_CONTACT_FORM_7_IS_ACTIVE ) {
          wp_deregister_style( 'contact-form-7' );
        }
    
      }

    Thanks!

    #1090546
    lemag
    Participant

    Are you sure this is the correct code? It looks completely not related to our issue. We are using Renew stack and we are trying to remove the google fonts but that code messes our website. When we add this code the an error and the entire site is not working.

    The gamerobo.visualpath.net page isn’t working

    gamerobo.visualpath.net is currently unable to handle this request.
    HTTP ERROR 500

    Please provide a solution to this issue because none of the ones you suggested are working properly.

    #1090930
    Rad
    Moderator

    Hi there,

    Yes, it should work. It’s originally from here \wp-content\themes\x\framework\functions\global\enqueue\styles.php and just removed this line, x_enqueue_google_fonts();

    If you like, you can just edit that file directly and remove that line.

    Thanks!

    #1091445
    lemag
    Participant

    We have tried removing that line of code but the fonts still appear. We have flushed the cache and minify cache but they still appear. I really have no idea what to try next.

    #1091461
    Rue Nel
    Moderator

    Hello There,

    The remaining Google fonts (http://prntscr.com/bu96a8) is coming from LayerSlider and Slider Revolution plugin. You may need to edit your sliders and make sure that Google font is loaded. You can usually find this in Slider Settings > Google Fonts.

    If you are not using any of these plugins, please deactivate it instead.

    Hope this helps.

    #1091477
    lemag
    Participant

    Hello,

    I have deactivated LayerSlider, Slider Revolution and Soliloquy but the fonts are still loaded.

    #1091485
    Rue Nel
    Moderator

    Hello There,

    The Essential Grid plugin is also created by ThemePunch and it seems that you have set Google fonts in there. Please do check Punch Fonts in your dashboard.
    http://prntscr.com/bu9fqc

    After deactivating the plugins, since you have installed a caching plugin W3 Total Cache, please clear your plugin cache first before testing your site. This can cause the changes to not take place on the front end. It will eventually show up when the cache regenerates, but it’s not ideal if you’re looking to see your changes immediately. Caching plugins are best to turn on only when you’ve finished building the site.

    Thank you.

    #1091517
    lemag
    Participant

    Hello,

    We have removed almost all google fonts but there still is one which we can’t find. We have removed google fonts from ConvertPlug as well but there is one more:
    <link
    rel=’stylesheet’ id=’open-sans-css’ href=’https://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&#8217; type=’text/css’ media=’all’ /><link

    #1091522
    Lely
    Moderator

    Hi There,

    To check where it is coming from, please try to disable all your plugins. Then check again if that font is still loaded. If not, it means that one plugin was using those font. Now to check which one, please activate each plugin one by one and then check if it’s loaded after each plugin activation.

    Hope this helps.

    #1104580
    turnkeyflyers
    Participant

    Hi, I am interested in removing google fonts as well. Will this code work for my site as well: http://www.turnkeyflyers.com ?

    Thank you,

  • <script> jQuery(function($){ $("#no-reply-1089877 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>