有些站点可能不需要这个功能,如果你正好同样是这个问题,那么考虑使用下面这段代码吧:
1 2 3 4 5 6 7 8 9 10 11 |
function wpb_disable_feed() { wp_die( __('No feed available,please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!') ); } add_action('do_feed', 'wpb_disable_feed', 1); add_action('do_feed_rdf', 'wpb_disable_feed', 1); add_action('do_feed_rss', 'wpb_disable_feed', 1); add_action('do_feed_rss2', 'wpb_disable_feed', 1); add_action('do_feed_atom', 'wpb_disable_feed', 1); add_action('do_feed_rss2_comments', 'wpb_disable_feed', 1); add_action('do_feed_atom_comments', 'wpb_disable_feed', 1); |
代码使用方法也是非常简单的,直接添加到主体目录下的function.php下即可,如果你还是不会代码或者不知道如何操作,那么使用下面的插件同样可以达到这个效果:
插件地址: https://wordpress.org/plugins/disable-feeds/ ,安装插件后,前往后台-》设置-》阅读,即可看到相关设置