A-A+
WordPress程序带的RSS订阅接口Feed API指向的域名变成非法BC网站,记得屏蔽Feed功能。
看到有人接到服务器厂商的通知,让清理非法内容,仔细一看是源代码中的RSS订阅接口Feed API接口中的域名变成了非法内容。

xmlns:wfw="http://wellformedweb.org/CommentAPI
wellformedweb.org 已经被非法组织接管了~
一般Feed接口也用不到,建议大家屏蔽就可以了。
方法如下:
1.安装插件 Disable Feeds WP
2.代码禁用
代码禁用,在主题的 functions.php 文件中添加以下代码:
// 禁用所有 Feed
function disable_all_feeds() {
wp_die(
'<h1>本站已禁用订阅功能</h1>
<p>请直接访问网站获取最新内容。</p>
<p><a href="' . home_url() . '">返回首页</a></p>',
'订阅已禁用',
array('response' => 403)
);
}
// 禁用 RSS、Atom、RDF 等所有 Feed
add_action('do_feed', 'disable_all_feeds', 1);
add_action('do_feed_rdf', 'disable_all_feeds', 1);
add_action('do_feed_rss', 'disable_all_feeds', 1);
add_action('do_feed_rss2', 'disable_all_feeds', 1);
add_action('do_feed_atom', 'disable_all_feeds', 1);
// 禁用评论 Feed
add_action('do_feed_rss2_comments', 'disable_all_feeds', 1);
add_action('do_feed_atom_comments', 'disable_all_feeds', 1);
// 移除 head 中的 Feed 链接
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
其实我以前也发过类似文章,建议屏蔽。
如何彻底移除并关闭WordPress的RSS也就是feed订阅功能?
