• Resolved Creative Slice

    (@creativeslice)


    I cannot find a way to remove the Merriweather font from the header without changing core plugin files.

    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic">

    The above is being called even when I’m using other fonts on a site and there does not seem to be an action to remove it.

    Is there a fix for this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Creative Slice

    (@creativeslice)

    I’ve been able to “fix” this by deleting this from /includes/class-amp-post-template.php

    https://cs.zone/F11n

    Would be great to have an action or filter to be able to do this.

    Thread Starter Creative Slice

    (@creativeslice)

    Figured it out!

    add_filter( 'amp_post_template_data', 'custom_adjust_amp_settings' );
    function custom_adjust_amp_settings( $data ) {
        $data['font_urls'] = array(
            'Libre Baskerville' => 'https://fonts.googleapis.com/css?family=Libre+Baskerville:400,700,400italic',
        );
        return $data;
    }

    Thanks, but this will only change the link source in the header, css will still reference Merriweather font.

    We need a way to either completely remove custom font or replace it with ours (e.g. without changing the entire default in-page css).

    • This reply was modified 7 years, 10 months ago by Darko A7.

    Hey please did you guys finally figure out how to remove this Merriweather font? It’s really increasing page load time

    EDIT: Found it and it works.

    /**
    * Do not load Merriweather Google fonts on AMP pages
    */
    add_action( ‘amp_post_template_head’, ‘isa_remove_amp_google_fonts’, 2 );
    function isa_remove_amp_google_fonts() {
    remove_action( ‘amp_post_template_head’, ‘amp_post_template_add_fonts’ );
    }

    Source: https://isabelcastillo.com/wordpress-amp-plugin

    • This reply was modified 7 years, 5 months ago by Udegbunam Chukwudi. Reason: Solved the problem
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove Merriweather Font’ is closed to new replies.