隐藏与修改wordpress默认http头信息X-Pingback

利用站长工具的http状态查询工具查询可以看到类似如下的一段http HEAD信息

X-Pingback: http://xxxx.com/xmlrpc.php

据说由于安全考虑,不想显示此消息,如何来隐藏wordpress默认http HEAD信息中的X-Pingback信息呢?使用以下代码即可:

 function aiboshuo_pingback($headers) {
 unset($headers['X-Pingback']);
 }
 add_filter(‘wp_headers’, ‘v7v3_pingback’);

使用以上代码即可隐藏WordPress博客中X-Pingback的信息了,那么如何在wordpress的http头信息中添加你想要的信息呢使用以下代码即可:

 function aiboshuo_header($headers) {
 $headers['power by'] = ’https://pdbn.top/’;
 return $headers;
 }

代码都是加到functions.php最后一个?>即可