Site logo

Archived topic

Remove Google fonts

4 replies · Started by Kim on August 30, 2019

Viewing posts 1–5 of 5

Hi, I've tried to remove the Google fonts from the customizer (as said in this post https://docs.generatepress.com/article/remove-google-fonts/). When I try to activate it I always get this error message:

Cannot redeclare tu_remove_google_fonts() (previously declared in /home/wp/disk/wordpress/wp-content/plugins/code-snippets/php/snippet-ops.php(361) : eval()'d code:3)

It is causing a fatal error in line 4. Am I doing something wrong?

Hi there,

Try this instead:

add_action( 'admin_init', 'tu_remove_google_fonts_customizer' );
function tu_remove_google_fonts_customizer() {
    add_filter( 'generate_google_fonts_array', '__return_false' );
}

Let me know if this helps :)

Awesome! Works perfectly :-)

This code always breaks my customiser.

No problem :)

This archived topic is closed to new replies.