<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>运达&#039;s  blog &#187; Google Fonts</title>
	<atom:link href="https://www.yunda51.com/?feed=rss2&#038;tag=google-fonts" rel="self" type="application/rss+xml" />
	<link>https://www.yunda51.com</link>
	<description>运达的博客</description>
	<lastBuildDate>Wed, 12 Nov 2025 07:58:26 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.19</generator>
	<item>
		<title>Google Fonts导致WordPress 速度问题</title>
		<link>https://www.yunda51.com/?p=1337</link>
		<comments>https://www.yunda51.com/?p=1337#comments</comments>
		<pubDate>Fri, 20 Jun 2014 10:59:32 +0000</pubDate>
		<dc:creator><![CDATA[运达]]></dc:creator>
				<category><![CDATA[php技术]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Google Fonts]]></category>

		<guid isPermaLink="false">http://www.yunda51.com/?p=1337</guid>
		<description><![CDATA[最近下载的wordpress3.9版本,安装之后特别慢,最后发现是Google Fonts导致的,真让人蛋疼.<a href="https://www.yunda51.com/?p=1337" class="read-more">Continue Reading</a>]]></description>
				<content:encoded><![CDATA[<p>最近下载的wordpress3.9版本,安装之后特别慢,最后发现是Google Fonts导致的,真让人蛋疼.<br />
<strong>Google Fonts导致WordPress 速度问题之原因</strong><br />
WordPress 自3.8+版本后加入了Google Fonts（别问我Google Fonts是什么了），然后捏，因为近期敏感周期（35号），天朝发威，谷歌的一系列网站被彻底墙，包括Google Fonts 所在的googleapis.com 。所以，如果是在登陆状态下打开你的WordPress 站点，会非常慢，因为压根儿加载不了这个字体文件。如果是非登陆状态且你的主题不是老外的主题，一般来说都是正常的。</p>
<p><strong>解决方法</strong><br />
出来问题就要解决，在天朝，既然你不得不忍受之，那么就换个思路变通一下。下面的解决方法，思路一是禁止加载该Google Fonts，二是替换加载源。下面说明之：</p>
<p><strong>方法一：</strong>【插件】禁止WordPress 后台加载Google Fonts</p>
<p>安装启用 Disable Google Fonts 或者 Remove Open Sans font Link from WP core 其中之一即可。没啥好说的。</p>
<p><strong>方法二：</strong>【代码】直接在functions.php 文件添加代码</p>
<p>网络上有不少代码，下面可以参考下，具体有没有效果没有确认：</p>
<pre class="wp-code-highlight prettyprint">
add_filter(&#039;gettext_with_context&#039;, &#039;disable_open_sans&#039;, 888, 4 );
      function disable_open_sans( $translations, $text, $context, $domain ){
             if ( &#039;Open Sans font: on or off&#039; == $context &amp;&amp; &#039;on&#039; == $text ) {
             $translations = &#039;off&#039;;}return $translations;} 
      function dw_remove_open_sans() {      
            wp_deregister_style( &#039;open-sans&#039; );          
            wp_register_style( &#039;open-sans&#039;, false );         
            wp_enqueue_style(&#039;open-sans&#039;,&#039;&#039;);      } 
            add_action( &#039;init&#039;, &#039;dw_remove_open_sans&#039; );
</pre>
<p>方法三：【代码】替换open sans 字体的加载源</p>
<p>打开wordpress代码中的文件wp-includes/script-loader.php文件，搜索：fonts.googleapis.com 找到这行代码：</p>
<p>$open_sans_font_url = "//fonts.googleapis.com/css?family1=Open+Sans:300italic,400italic,600italic,300,400,600&#038;subset=$subsets";</p>
<p>把fonts.googleapis.com替换为fonts.useso.com。<br />
转载请注明转自:<a href="http://www.yunda51.com">运达's blog</a>  原文地址：<a href="http://www.yunda51.com/1337.html">http://www.yunda51.com/1337.html</a></p>
]]></content:encoded>
			<wfw:commentRss>https://www.yunda51.com/?feed=rss2&#038;p=1337</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
