移除wordpress版本信息 删除无用信息
2013-11-08 10:58
337 查看
wordpress页面头部有很多无用的信息,像wordpress版本信息、feed等,如何把它们删除或不让它们先是出来呢?
将下面的代码加入到当前主题的functions.php,可以适当酌情保留
将下面的代码加入到当前主题的functions.php,可以适当酌情保留
<?php //remove_action( 'wp_head', 'wp_enqueue_scripts', 1 ); remove_action( 'wp_head', 'feed_links', 2 ); remove_action( 'wp_head', 'feed_links_extra', 3 ); remove_action( 'wp_head', 'rsd_link' ); remove_action( 'wp_head', 'wlwmanifest_link' ); remove_action( 'wp_head', 'index_rel_link' ); remove_action('wp_head', 'parent_post_rel_link', 10, 0 ); remove_action('wp_head', 'start_post_rel_link', 10, 0 ); remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); //remove_action( 'wp_head', 'locale_stylesheet' ); remove_action( 'publish_future_post', 'check_and_publish_future_post',10, 1 ); //remove_action( 'wp_head', 'noindex', 1 ); //remove_action( 'wp_head', 'wp_print_styles', 8 ); //remove_action( 'wp_head', 'wp_print_head_scripts', 9 ); remove_action( 'wp_head', 'wp_generator' ); //remove_action( 'wp_head', 'rel_canonical' ); remove_action( 'wp_footer', 'wp_print_footer_scripts' ); remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); remove_action( 'template_redirect', 'wp_shortlink_header', 11, 0 ); add_action('widgets_init', 'my_remove_recent_comments_style'); function my_remove_recent_comments_style() { global $wp_widget_factory; remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ,'recent_comments_style')); } ?>
相关文章推荐
- 教你如何删除WordPress的版本信息
- WordPress 主题制作技巧之五 [ 由add_action和remove_action领衔的无用主题信息删除 ]
- 如何删除和重新安装 Internet 信息服务 (IIS) 版本 5.0 和 5.1。
- 删除.svn版本信息 java 类实现
- 删除SVN、CVS等版本控制信息
- 删除SVN版本信息 .svn文件夹
- 删除svn版本控制信息
- 去除WordPress所有的版本信息
- 删除SVN版本信息 .svn文件夹
- 删除SVN、CVS版本控制信息
- 删除SVN、CVS等版本控制信息
- 删除SVN版本信息 .svn文件夹
- 一次性批量删除重复信息并保留一条的SQL-所有版本通用
- C#:获得文件版本信息及只读文件的删除
- [2014-02-19]如何移除响应头中的.net framework 版本信息 以及mvc版本信息?
- 删除无用的DC信息
- 删除Maven仓库无用的版本
- 删除本地拷贝里的所有SVN版本信息
- Windows下删除版本控制信息
- WordPress如何禁用并删除文章修订版本记录