PHP Wordpress:从默认的Wordpress安装中删除标题垃圾

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP Wordpress:从默认的Wordpress安装中删除标题垃圾相关的知识,希望对你有一定的参考价值。

/** ******** ******** ******** ******** ******** ******** ******** ******** 
* TITLE: Remove unnecessary meta-data from your WordPress site
* DESCRIPTION: Over the years, wordpress has placed a lot of junk in their system. 
*/
function remove_header_extra(){
	//Are you editing your WordPress blog using your browser? Then you are not using a blog client
	remove_action('wp_head', 'rsd_link');
	// Windows Live Writer is (it’s another blog editing client
	remove_action('wp_head', 'wlwmanifest_link');
	//This announces that you are running WordPress and what version you are using. 
	remove_action('wp_head', 'wp_generator');
	//URL shortening is sometimes useful, but this automatic ugly url in your header is useless.
	remove_action('wp_head', 'wp_shortlink_wp_head');
	// Display the links to the general feeds: Post and Comment Feed
	remove_action('wp_head', 'feed_links', 2);
	//// Display the links to the extra feeds such as category feeds
	remove_action('wp_head', 'feed_links_extra', 3);
	//Deprecated
	remove_action('wp_head', 'index_rel_link');
	// start link
	remove_action('wp_head', 'start_post_rel_link', 10, 0);
	// prev link
	remove_action('wp_head', 'parent_post_rel_link', 10, 0);
	// Display relational links for the posts adjacent to the current post.
	remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
}
add_action('init', 'remove_header_extra');

以上是关于PHP Wordpress:从默认的Wordpress安装中删除标题垃圾的主要内容,如果未能解决你的问题,请参考以下文章

PHP Wordpress:从默认的Wordpress安装中删除标题垃圾

wordpress 插件是啥意思

从帖子标题获取 WordPress 帖子 ID

PHP Wordpress - 从默认库中删除内联样式

CentOS 6.5安装WordPress(基于LNMP)

Wordpress 搜索功能仅搜索帖子