Remove GoogleWebFonts (4 posts)

  1. Max Mustermann
    Posted 1 year ago #

    Hi i am using the epic theme and would like to know how to disable all googleapis.font calls inside the theme.
    I was playing arround with the header.php, Epic.php, function.php and some plugins but nothing really helped. I still get calls from google concerning the Open Sans fonts.
    Could you please tell me where you refer to the webfonts.url inside the theme ?
    Thank you in advance :D

  2. Slocum Themes
    Theme Author

    Posted 1 year ago #

    Hi Max,

    You may want to try hooking into the wp_enqueue_scripts action and using wp_dequeue_script() to remove the 'open-sans-web-font' stylesheet that we are enqueuing.

    Thank You!

  3. Max Mustermann
    Posted 1 year ago #

    I tried to integrate the following functions into the functions.php of my child theme, but sadly they don't work.


    Are you sure that 'open-sans-web-font' is the matching script name ?

    I heard about another solution but i'm not sure how to use it in this specific case.
    Could it be the solution ?

    function remove_inline_style() {
    	remove_action('wp_head', 'epic_header_style');
    	remove_action('wp_head', 'epic_admin_header_style');
    	remove_action('wp_head', 'epic_fonts');
    add_action('init', 'remove_inline_style');

    I don't realy know what i have to write between the quotation marks(instead of 'epic_fonts')
    Could you help me with that ?
    That would be very nice ;)

  4. Max Mustermann
    Posted 1 year ago #

    For everyone strugglin with the same problem.
    I added the following lines to my "functions.php" (of my child theme)

    add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 25 );
    function remove_default_stylesheet() {
    	wp_dequeue_style( 'open-sans-web-font' );
    	wp_deregister_style( 'open-sans-web-font' );

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic