从 WordPress 中删除 Google 字体

发布于 2025-01-20 02:30:56 字数 924 浏览 0 评论 0原文

In source of website I see this code:

<link href='//fonts.googleapis.com/css?family=Poppins:400,400italic,500italic,500' rel='stylesheet' type='text/css'><link href='//fonts.googleapis.com/css?family=Poppins:400,400italic,500' rel='stylesheet' type='text/css'> <style type="text/css">.

It doesn't have ID so I can't remove it from functions.php

Steps I have done to remove it:

  1. installed plugin Disable/Remove Google Fonts, but it not helped< /p>

  2. In functions.php added this function:

      add_filter('style_loader_src',function($ href){if(((strepos($ href,“ //fonts.googleapis.com/” {返回$ href;}返回false;});
     

but still nothing changed.

  1. 禁用所有插件,将主题更改为不同的插件,但仍然没有。

我真的需要删除它们,因为它在网站上增加了1秒的延迟。

您可以建议什么完全删除它? (我使用本地自定义字体)

In source of website I see this code:

<link href='//fonts.googleapis.com/css?family=Poppins:400,400italic,500italic,500' rel='stylesheet' type='text/css'><link href='//fonts.googleapis.com/css?family=Poppins:400,400italic,500' rel='stylesheet' type='text/css'> <style type="text/css">.

It doesn't have ID so I can't remove it from functions.php

Steps I have done to remove it:

  1. installed plugin Disable/Remove Google Fonts, but it not helped

  2. In functions.php added this function:

     add_filter( 'style_loader_src', function($href){ if ((strpos($href, "//fonts.googleapis.com/") === false) || !is_page(31765)) { return $href;} return false;});
    

but still nothing changed.

  1. disabled all plugins, changed theme to different one, but still nothing.

I really need to remove them because it adds 1 second delay to website.

What can you suggest to remove it completely? (I use local custom fonts)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文