为网站加速:移除WordPress后台加载的小工具

移除WP为仪表盘(dashboard)页面加载的小工具,可以大大减轻网站加载速度,这个自不必说。

后台打开外观>function函数,在function.php的后面加上下面的代码即可。你就可以放心大胆的全部移除吧。

function cwp_remove_dashboard_widgets() {
    global $wp_meta_boxes;
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']);
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}
add_action('wp_dashboard_setup', 'cwp_remove_dashboard_widgets',11 );

相关阅读:移除WordPress中一些自带的小工具

欢迎转载,转载请注明本文链接:众推不靠谱 » 为网站加速:移除WordPress后台加载的小工具

吐槽 0


  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址