wordpress後臺載入速度緩慢解決辦法
阿新 • • 發佈:2021-02-10
1、gravatar使用者頭像
載入的時間長;很多朋友使用的WordPress主題,基本都是使用的gravatar頭像,很遺憾的是,目前gravatar基本被牆光了。禁用gravatar頭像辦法如下:
後臺-設定-評論-去掉勾選顯示Avatars
參考:https://developer.aliyun.com/article/532834
2.load-scripts.php和 load-styles.php
通過谷歌開發者工具分析是load-scripts.php和 load-styles.php 這兩個檔案導致後他速度的緩慢。
解決方案就是在wp-config.php檔案中加入
define('CONCATENATE_SCRIPTS', false);
儲存重新整理後臺後,速度就快了很多。
參考
https://www.tzwl420.club/493.html
3.google字型
另外谷歌字型導致後臺速度慢也是原因之一。可以通過貼上一下程式碼到主題function.php中
//禁用谷歌字型
if (!function_exists('remove_wp_open_sans')) :
function remove_wp_open_sans() {
wp_deregister_style( 'open-sans' );
wp_register_style( 'open-sans' , false );
}
// 前臺刪除Google字型CSS
add_action('wp_enqueue_scripts', 'remove_wp_open_sans');
// 後臺刪除Google字型CSS
add_action('admin_enqueue_scripts', 'remove_wp_open_sans');
endif;