将以下代码插入到functions.php文件中,即可禁用Feed。

function wpjzp_feed_disabled()
{
    wp_die("Feed已经关闭, 请访问网站<a href="" . get_bloginfo("url") . "">首页</a>!");
}
 
add_action("do_feed", "wpjzp_feed_disabled", 1);
add_action("do_feed_rdf", "wpjzp_feed_disabled", 1);
add_action("do_feed_rss", "wpjzp_feed_disabled", 1);
add_action("do_feed_rss2", "wpjzp_feed_disabled", 1);
add_action("do_feed_atom", "wpjzp_feed_disabled", 1);

【免费WP主题QQ群:556319531】

技术文档