傻大憨

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后台添加一个自定义页面,一个所有用户可见,一个只有编辑权限的用户可见。

WordPress外贸建站平台优势与特点一览

  在众多建站平台中,WordPress一直以其强大的功能和灵活性而备受欢迎。特别是在外贸行业,选择一个适合的… Continue reading WordPress外贸建站平台优势与特点一览

wordpress建站必备的函数大全

wordpress主题二次开发时常用到的函数

打造专业WP外贸建站平台功能全面解析

  在全球化的商业环境中,拥有一个专业且高效的外贸网站对于企业的成功至关重要。WordPress作为一款强大而… Continue reading 打造专业WP外贸建站平台功能全面解析

WoWSOHO专业wordpress外贸建站平台

wowsoho.com的WordPress 外贸建站平台凭借其强大的功能、多语言支持和丰富的资源,成为外贸企业和个人建站的首选平台。