傻大憨

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反馈表单的代码,可以实现通过电子邮件接收提交的数据。

定制WordPress外贸主题需要注意的事项

定制WordPress外贸主题时,企业需要注意明确目标与定位、选择可靠的主题开发商、考虑多语言支持、优化用户体验、注重SEO优化、确保安全与稳定性、关注灵活性与可扩展性以及进行全面的测试与调试。

用wordpress搭建网站选择模板指南

在用WordPress搭建网站选择模板时,应明确网站目标和风格、考虑性能与安全性、评估功能与扩展性、考虑可定制性与文档支持、关注主机环境和兼容性等。

WooCommerce商城主题的安全性决定跨境电商之路能不能更稳 更远

WooCommerce以其开源、灵活、功能强大的特点,成为众多商家进军电商领域的首选工具。然而,在搭建WooCommerce商城的过程中,一个经常被忽视却至关重要的问题,就是WooCommerce商城主题的安全性。

wordpress怎么调用页面别名

在制作wordpress主题时常常会用到调用页面的别名,下面这段代码可以完美解决,wordpress页面别名调用的问题。

阿拉伯语网站建设成本分析与建站方案选择指南

随着”一带一路”倡议的深入推进,中国与阿拉伯世界的贸易往来日益频繁,越来越多中国企业选择拓展中东市场。建阿拉伯语网站,成为了做好中东市场的第一步。