Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active August 4, 2024 00:08
Show Gist options
  • Save KaineLabs/22d1a44f356350ec4cb0c481df6d512a to your computer and use it in GitHub Desktop.
Save KaineLabs/22d1a44f356350ec4cb0c481df6d512a to your computer and use it in GitHub Desktop.
Remove Youzer Google Fonts
<?php
/**
* Remove Youzer Google Fonts.
*/
function yzc_remove_google_fonts() {
wp_dequeue_style( 'yz-opensans' );
wp_deregister_style( 'yz-opensans' );
}
add_action( 'wp_enqueue_scripts' , 'yzc_remove_google_fonts', 999 );
@b0br2019
Copy link

b0br2019 commented Oct 4, 2020

to actually remove the woff files from being loaded you should change code to include this?

wp_deregister_style

e.g.

function yzc_remove_google_fonts() {
    wp_dequeue_style( 'yz-opensans' );
    wp_deregister_style('yz-opensans');

@KaineLabs
Copy link
Author

wp_deregister_style

Done i updated the snippet, thank you so much for reporting this :)

Stay safe and have a great week!

@SuiteCom
Copy link

FYI the style name is now youzify-opensans. By replacing yz-opensans with it in the given function, Google Fonts are removed.

(Using Youzify v3.3.3)

@bbbjames
Copy link

bbbjames commented Aug 4, 2024

thank you for this guys! 🫡

my site is crashing, is this still the way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment