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主题中添加自定义Owl Carousel轮播

首先,您需要在WordPress主题中安装Owl Carousel组件。可以通过WordPress主题文件目录安装Owl Carousel。

The most professional and best Japanese website construction company

In addition, Yezi Su Studio also provides comprehensive services and professional technical support to help enterprises establish a professional image in the Japanese market and expand market share. Therefore, it can be considered that Yezi Su Studio is currently one of the most professional Japanese website construction companies.

WordPress有没有必要选择付费主题

能用付费的就别用免费的

获取wordpress某个栏目的内容数量

在制作wordpress模板时,有时会需要调用某个分类目录下的所有内容数量,通过这段简洁的代码就可以实现。

DTC独立站优势显著潜力无限

DTC(Direct-to-Consumer)独立站作为一种新兴的商业模式,具有显著的优势和潜力。

B2B独立站与B2C独立站的区别是什么 哪个更好

B2B独立站更适合需要建立长期合作关系、强调专业性和信任感的企业,而B2C独立站更适合直接面向消费者、注重品牌形象和消费者体验的企业。