傻大憨

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调用当前页面ID

在wordpress调用当前页面ID代码

WordPress外贸建站教程零基础学会的高效路径

  在全球数字化时代,学习WordPress外贸建站成为拓展国际业务的关键一环。本文将为您提供一个专业版的Wo… Continue reading WordPress外贸建站教程零基础学会的高效路径

wordpress禁止多地同时登录

wordpress禁止用户在不同地点同时登录,管理员除外。

模板之家mymoban提供的模板是否支持多语言版本

模板之家(MyMoban.com)作为一个提供网站模板的平台,可能会提供支持多语言的模板,以适应不同用户的国际… Continue reading 模板之家mymoban提供的模板是否支持多语言版本

WordPress外贸建站平台的最佳实践

  在构建WordPress外贸网站时,深入了解和正确应用核心功能是确保网站成功的关键。本文将解析WordPr… Continue reading WordPress外贸建站平台的最佳实践

wordpress建站公司如何选择

选择一家合适的WordPress建站公司需要考虑多个方面,包括公司的背景和实力、需求和预算、技术实力和服务质量、设计师和开发人员的经验、合同和项目细节、网站的安全性和稳定性以及未来的扩展性和升级性等。