WordPress前台顶部清理,将下方代码添加进你的Wordpress插件或者正在使用的Wordpress主题的functions.php之后,多余的查询和文件加载的问题已经不存在了:
//WP前台顶部清理
function cwp_header_clean_up(){
if (!is_admin()) {
foreach(array('wp_generator','rsd_link','index_rel_link','start_post_rel_link','wlwmanifest_link') as $clean){remove_action('wp_head',$clean);}
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
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', 10, 0 );
foreach(array('single_post_title','bloginfo','wp_title','category_description','list_cats','comment_author','comment_text','the_title','the_content','the_excerpt') as $where){
remove_filter ($where, 'wptexturize');
}
/*remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );*/
wp_deregister_script( 'l10n' );
}
}
未经允许不得转载:WordPress组织 » WordPress前台顶部清理
评论前必须登录!