傻大憨

wordpress移除wp_head不常用代码

把不常用的代码移除,让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 版本号
}
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 相关的link
 
remove_action("wp_head", "index_rel_link");                //删除 head 中首页,上级,开始,相连的日志链接
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 标签。
remove_action("template_redirect", "rest_output_link_header", 11);    // 禁止输出 Header Link 标签。
Published
Categorized as 建站知识 Tagged ,

By 傻大憨

shadahan.com是一个关注跨境电商、创业话题的网站。

揭秘成功WordPress外贸建站的关键要素

在当今数字化时代,通过WordPress建立外贸网站已经成为许多企业成功开展国际贸易的关键要素之一。本文将揭秘… Continue reading 揭秘成功WordPress外贸建站的关键要素

Elementor优点很明显 缺点很致命

Elementor是一个非常强大的可视化网站建设工具,它可以让用户通过拖拽和编辑来快速构建网站。虽然Elementor具有许多优点,但是它也存在一些缺点。下面我将从多个角度来探讨Elementor的优缺点。

WordPress外贸整站源码解析与应用技巧分享

  开源软件的魅力在于它的灵活性和可定制性。WordPress作为一款广受欢迎的开源建站工具,在外贸领域也有着… Continue reading WordPress外贸整站源码解析与应用技巧分享

给wordpress添加带区块编辑器的文章类型

给wordpress添加带区块编辑器的自定义文章类型

WordPress外贸网站建设的核心要素与实战案例

  在全球数字化时代,WordPress外贸网站成为企业拓展国际市场的重要工具。本文将深入探讨成功建设Word… Continue reading WordPress外贸网站建设的核心要素与实战案例

WordPress外贸建站程序对比

  在选择建站引擎时,WordPress是许多企业和个体创业者的首选。然而,WordPress本身有各种不同的… Continue reading WordPress外贸建站程序对比