• Resolved neoxyn

    (@neoxyn)


    Hi guys!

    I m trying to remove google fonts from the neve theme, that I can host them manually for gdpr reasons.

    I m looking for a code for the functions.php, because I dont want to use a plugin.

    Thanks in advance and best regards,

    Neoxyn

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi, @neoxyn!

    To make custom changes in the code, I strongly advise you to use the method that implies modifying the child theme. However, it should be possible to remove Google fonts by inserting the code below at the end of the functions.php file.

    function remove_google_fonts_stylesheet() {
    wp_dequeue_style(‘themeisle-gutenberg-google-fonts-645’);
    }
    add_action(‘wp_enqueue_scripts’, ‘remove_google_fonts_stylesheet’, 999);

    Thank you and have a nice day!

    Hi

    Thanks for the code but I got some errors.

    Please check

    https://ibb.co/6vK2k3X

    Also please let us know is there any way to download the google font and host locally.

    Hi, neoxyn, I’m another user of the Neve theme.

    I can at the very least guide you as to why you’re getting an error with the code: the error that you have is because the quotes in the provided code is using curly quotes instead of straight quotes.

    So instead the code should be:

    function remove_google_fonts_stylesheet() {
    wp_dequeue_style('themeisle-gutenberg-google-fonts-645');
    }
    add_action('wp_enqueue_scripts', 'remove_google_fonts_stylesheet', 999);

    Hi, @holidaystory17!

    Indeed, @plantprogrammer is right. It seems that after you copied the code, the apostrophes were automatically changed. Please make sure to manually replace all the apostrophes so they will be the same as the ones from the 14th line from your screenshot, for example.

    Let me know if this worked.

    Have a nice day!

    yes, Now the error is gone but I still found google font loading on my site.

    https://ibb.co/8bhgGWg

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remove google fonts’ is closed to new replies.