把不常用的代碼移除,讓wordpress快起來,想要非一樣的感覺,可以試試。
remove_action("wp_head", "wp_generator");
foreach (["rss2_head", "commentsrss2_head", "rss_head", "rdf_header", "atom_head", "comments_atom_head", "opml_head", "app_head"] as $action) {
remove_action($action, "the_generator"); //刪除 head 中的 WP 版本號(hào)
}
remove_action("wp_head", "rsd_link"); //刪除 head 中的 RSD LINK
remove_action("wp_head", "wlwmanifest_link"); //刪除 head 中的 Windows Live Writer 的適配器?
remove_action("wp_head", "feed_links_extra", 3); //刪除 head 中的 Feed 相關(guān)的link
remove_action("wp_head", "index_rel_link"); //刪除 head 中首頁,上級(jí),開始,相連的日志鏈接
remove_action("wp_head", "parent_post_rel_link", 10);
remove_action("wp_head", "start_post_rel_link", 10);
remove_action("wp_head", "adjacent_posts_rel_link_wp_head", 10);
remove_action("wp_head", "wp_shortlink_wp_head", 10, 0); //刪除 head 中的 shortlink
remove_action("wp_head", "rest_output_link_wp_head", 10); // 刪除頭部輸出 WP RSET API 地址
remove_action("template_redirect", "wp_shortlink_header", 11); //禁止短鏈接 Header 標(biāo)簽。
remove_action("template_redirect", "rest_output_link_header", 11); // 禁止輸出 Header Link 標(biāo)簽。