SOHO创业

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 SOHO

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

买wordpress主题是否要看支持不支持Elementor

先搞清楚Elementor是什么非常重要,没搞清楚前,不要盲目瞎跟风。

一段代码就可禁止wordpress自动更新

进行过二次开发的wordpress网站,最好要把自动更新禁止了。不然,自动更新后的wordpress网站可能无法访问。

WordPress外贸网站建设的最佳实践

  在当今数字化的商业环境中,WordPress成为了许多外贸企业建设网站的首选平台之一。本文将深入解读一些成… Continue reading WordPress外贸网站建设的最佳实践

模板页是一个卖成品网站模板的平台

模板页mobanye.com是一个为企业用户提供高效、便捷、低成本建站解决方案的优质平台,无论是个人博客还是企业官网,都能在这里找到合适的模板资源。

如何添加wordpress文章形式

wordpress的功能很强,通过文章形式,可以让wordpress文章,有多种形式来展示。并不是所有的主题都有wordpress的文章形式,如果想有文章形式,将以下代码添加到 functions.php文件中即可。

开源程序wordpress在海外品牌推广中的重要作用

WordPress作为全球最流行的开源内容管理系统(CMS),在全球网站搭建中占据超过40%的市场份额。