傻大憨

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自建站如何备份和恢复数据

请注意,备份和恢复数据时,确保选择正确的备份文件,以免覆盖或恢复错误的数据。

WP快主题

WP快主题强调“快”,即快速搭建、快速上线。其主题通常具备简洁的代码结构和高效的加载性能,适合需要快速部署网站的用户,尤其适合对网站速度有较高要求的电商和企业用户。

WordPress外贸建站服务的最佳实践与管理

  在竞争激烈的国际市场中,拥有一款优秀的WordPress外贸建站是提升业务效益的关键。本文将分享一些最佳实… Continue reading WordPress外贸建站服务的最佳实践与管理

WordPress菜单函数wp_nav_menu各参数

在不同的位置调用不同的菜单,使用下面的这个代码

用wordpresss搭建外贸网站非常简单

2020年以来,以国内大循环为主体、国内国际双循环相互促进的新发展格局已经建立。我国的优秀企业,要想生存发展的更好,搭建外贸网站出海,已经是关系到生死存亡的必选项了。

The best independent website building platform for foreign trade

The best template website building platform