Support » Plugin: YITH WooCommerce Badge Management » google pagespeed complaining about “font-display” issue with yith fonts

  • Resolved mordimpark

    (@mordimpark)


    Hi,

    google pagespeed is complaining about the three fonts loaded by yith badgemanagement:
    “Ensure text remains visible during webfont load” and “Warnings: Lighthouse was unable to automatically check the font-display value for the origin …”

    Regarding to pagespeed the delay of the three fonts is quite huge (more than half a second)

    I am only using the builtin “new” image badge, so in theory I do not need any of the three fonts loaded from yith badgemanagement plugin folder. Is there any way to stop loading those fonts or fix the font-display issue mentioned by google pagespeed?

    Thanks a lot in advance,
    Andreas

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support crodriguez1991

    (@crodriguez1991)

    Hello there,

    Thanks for contacting us and I hope you’re doing well 😀

    If you want to remove the fonts added by our plugin, you need to add the following code in the functions.php of your active theme

    if( !function_exists( 'yith_wcbm_remove_open_sans_font_request' ) ){
    	function yith_wcbm_remove_open_sans_font_request(){
    		wp_dequeue_style('yith-gfont-open-sans');
    	}
    	add_action( 'wp_enqueue_scripts','yith_wcbm_remove_open_sans_font_request',99 );
    }

    The open sans font is the only font added by our plugin.

    Please, try it and let me know.

    Have a good day.

    Thread Starter mordimpark

    (@mordimpark)

    Hi Carlos,

    thanks a lot. I have slightly adopted your code to use it in “Code Snippet” plugin. Font is now not causing pagespeed issues anymore. Thanks a lot for the great support.

    Here the snippet I am using in “Code Snippet” Plugin:

    add_action( 'wp_enqueue_scripts', 'yith_wcbm_remove_open_sans_font_request',999 );
    
    function yith_wcbm_remove_open_sans_font_request(){
    		wp_dequeue_style( 'yith-gfont-open-sans' );
    }

    BR, Andreas

    Plugin Support crodriguez1991

    (@crodriguez1991)

    Hello there,

    Thanks for contacting us and I hope you’re doing well 😀

    I’m glad my code helped you to get your goal and now you don’t have problems with pagespeed.

    Before close this topic, I would like to invite you to leave a review about our plugin in the following link

    If you have any other question or problem, don’t hesitate to open a new topic, we’ll be happy to help you.

    Have a good day.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘google pagespeed complaining about “font-display” issue with yith fonts’ is closed to new replies.