• Resolved AndrogenicAlopecia

    (@androgenicalopecia)


    In the most recent WordPress update, the Google fonts are now included:

    https://wordpress.org/news/2023/03/dolphy/

    Local fonts in themes: Default WordPress themes offer better privacy with Google Fonts now included.”

    So it seems like the Autoptimize option to Remove Google Fonts no longer works?

    The GTMetrix waterfall for my particular site/theme now shows 6 lato-latin fonts impacting the page load speed.

    Any solutions around this issue?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    technically AO removes CSS that is loaded from fonts.googleapis.com, if fonts are loaded locally, they’re not caught and hence not removed.

    If you can provide me with a link to your site where I can see the local Google fonts being loaded, I _might_ be able to come up with a workaround (a code snippet).

    Thread Starter AndrogenicAlopecia

    (@androgenicalopecia)

    Thanks for the offer. Was just curious if you could change something in the plugin itself to account for the new WordPress change. It is not a major speed issue so I will hold off (might get a new theme with different fonts in the near future anyway).

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I’ll test one of these days with one of the twenty-xyz themes and see what can be done.

    Thread Starter AndrogenicAlopecia

    (@androgenicalopecia)

    Can you test for WordPress Twenty Fourteen? It is loading at least 5-6 fonts and slowing down my site load by a full second.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Quick test sees wp-content/themes/twentyfourteen/fonts/font-lato.css being loaded which loads locally hosted fonts, so not really Google Fonts.

    But if you do want to remove those you could use a snippet like this (untested) one;

    add_filter(
      'autoptimize_filter_css_removables',
      function ( $in ) {
        return $in . ', wp-content/themes/twentyfourteen/fonts/font-lato.css';
      }
    );

    hope this helps,
    frank

    Thread Starter AndrogenicAlopecia

    (@androgenicalopecia)

    I messages you on Twitter. Did not want to post my domain and GTMetrix waterfall link here.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Well, you waterfall chart does not contain fonts loaded from the Google domain, the fonts are loaded from your own domain, so technically those are not Google Fonts any more 🙂

    If you don’t want the lato fonts to load, you can try try the code snippet I posted above?

    Thread Starter AndrogenicAlopecia

    (@androgenicalopecia)

    Thanks! Which file should the snippet be added into? This problem only started after the WordPress “dolphy” update this year FYI.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    The easiest & safest solution is using the code snippets plugin 🙂

    Thread Starter AndrogenicAlopecia

    (@androgenicalopecia)

    The last thing I like to do is add more plugins if possible 🙁 Even the best reviewed ones cause issues down the road and add extra code, show up in error logs etc. Even 8 years after I removed several well known ones (such as Wordfence), their names show in Google Search Console “Pages” section error breakouts.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, you can always add the code to your theme’s functions.php, but do take into account (and that’s why I advice against it) that that file gets overwritten with every theme update 🙂

    Thread Starter AndrogenicAlopecia

    (@androgenicalopecia)

    Makes sense, thanks again!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Remove Google Fonts no longer works?’ is closed to new replies.