• I use AO to reduce load time Google Fonts with webfont.js, then I want to change to other options with display=swap, but AO still show code webfont.js in source code. I tried option “leave as is”, even deactivated AO but the code webfont.js still appears. How can I remove it?

    <script type="text/javascript">
        WebFontConfig = {
          google: { families: [ "Muli:regular,700","Muli:regular,regular","Muli:regular,700","Dancing+Script:regular,400", ] }
        };
        (function() {
          var wf = document.createElement('script');
          wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
          wf.type = 'text/javascript';
          wf.async = 'true';
          var s = document.getElementsByTagName('script')[0];
          s.parentNode.insertBefore(wf, s);
        })(); </script>
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    That’s because your non-optimized page already has that code included, AO does not remove that type of Google Font code as webfont.js can also be used to load non-Google fonts. You’ll have to find out what theme/ plugin is adding that and ask the devs if that can be changed.

    hope this clarifies,
    frank

    Thread Starter Kokuryu

    (@viper_boy)

    I dont think so. Recently I cloned my website to another hosting to debug, and I just installed AO on only my main site yesterday. So I can compare sources code between them, and I realized my test site doesnt have webfontconfig code.
    On other hand, I also install WP-rocket on my main site same day with AO, but it doesnt have any option relate to webfont.js. I think maybe AO relate to this problem?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Can you share your site’s URL so I can have a look?

    Thread Starter Kokuryu

    (@viper_boy)

    Sure. My main site is https://www.glokard.com, and my test site is https://418125.net/staging

    I deactivated AO & WP-rocket on my main site. On my test site I use Swift Performance Lite but also deactivated.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, if you view the HTML source of your main site, you will indeed see the webfont.js code there, which confirms something -but not AO or WP Rocket, which are disabled as can be confirmed by the lack of references to it- is adding that. could be your theme, could be a plugin?

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

The topic ‘Can not remove webfont.js’ is closed to new replies.