傻大憨

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外贸网站建设的关键要素与技术要点

独立站正在为中国产品热销海外贡献巨大力量

独立站作为一种新兴的跨境电商模式,具有许多优势,使其成为中国企业品牌出海的重要渠道。

WordPress使用多语言插件的弊端及解决方法

多语言插件,好处是省事,坏处是翻译后的专业化内容准确率低,还有就是不符合当地用户的使用习惯。

WordPress外贸建站服务的成功实例分享

  在竞争激烈的外贸市场,提升用户满意度是建立和维护成功外贸网站的关键。本文将分享一些成功的WordPress… Continue reading WordPress外贸建站服务的成功实例分享

WordPress外贸建站教程实用技巧分享

  WordPress作为一款强大的建站平台,为外贸企业提供了丰富的功能和灵活的定制选项。在这篇教程中,我们将… Continue reading WordPress外贸建站教程实用技巧分享

wordpress父页面调用子页面标题

在服务项目父页面通过以下代码,调用出子页面的标题