wordpress后台操作速度慢的原因及解决方法
- 时间:2020-05-20 15:19:20
- 分类:网络文摘
- 阅读:112 次
近来,很多朋友反映wordpress的后台访问速度缓慢,让人无法忍受。究其原因有两个方面,都与谷歌服务被国内屏蔽有关,一是由于 wordpress 默认加载谷歌字体链接。二是部分朋友出于标题翻译的需要,使用了调用谷歌翻译服务器的 wordpress插件 wp slug translate 。由于Google被封,谷歌字体便无法正常加载,致使页面卡在 fonts.googleapis.com 链接上,而翻译服务器无法调用,导致更新文章缓慢和保存菜单超时。
解决此问题的wordpress技巧:
一、针对谷歌字体链接。
1、禁止wordpress后台加载谷歌字体链接。本站之前已有介绍,具体操作请参看此文章。
2、打开 /wp-includes/script-loader.php 搜索 fonts.googleapis.com 找到加载Google字体的代码,将 //fonts.googleapis.com/… 这个链接整个删除或用//注释掉。保存文件时请注意选择UTF-8编码格式,否则 wordpress 会报错。
3、替换谷歌字体库为360网站卫士的国内CDN节点。打开 /wp-includes/script-loader.php,约603行位置,将下图中箭头指示的fonts.googleapis.com换成fonts.useso.com即可。

二、针对wordpress翻译插件。
1、使用调用微软Bing翻译API接口的WP Slug Translate 插件(与wp slug translate区别就是大小写)。
2、使用调用有道翻译API接口的cos_slug_translator 插件。
关于以上两款插件的介绍和下载,可以参考:三款自动翻译文章标题为英文的wordpress插件介绍与比较。
三、使用可直接访问谷歌的hosts IP来解决。
通过修改本地hosts设置是解决本文所述问题最直接有效的方法,缺点是Google的可用IP总有时效性,需经常更新才行。优点是可以直接访问谷歌的所有服务,需要的朋友可以关注本站的另一篇文章:最新Google hosts文本持续更新
推荐阅读:Your Simple Guide to Ultimate Technology Stack Every Blogger Nee Recursive Algorithm to Encrypte a String Reconnect the Nodes in Linked List by Odd/Even in Place (Odd Eve Breadth First Search Algorithm to Find Nearest Right Node in Bin Using Priority Queue to Compute the Slow Sums using Greedy Algor Min Number of Operations to Crawler Log Folder Reclaiming the Disk Space by Deleting the Logs of the Docker Con How to Re-mount a RAID-1 Array into a RAID-0 on Linux VPS? Algorithm to Check if a Binary Tree can be Constructed via Hash Big O Simply Explained
- 评论列表
-
- 添加评论