WordPress completely disables the RSS function
If you think RSS is useless, you can also disable it directly by adding the following code to the theme functions.php function:
function itsme_disable_feed() {
wp_die( __( ‘No feed available, please visit the <a href=”‘.%20esc_url(%20home_url(%20’/’%20)%20)%20.'”>homepage</a>!’ ) );
}
add_action(‘do_feed’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_rdf’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_rss’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_rss2’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_atom’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_rss2_comments’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_atom_comments’, ‘itsme_disable_feed’, 1);
// Remove the RSS code of the web
page remove_action( ‘wp_head’, ‘feed_links_extra’, 3 );
remove_action( ‘wp_head’, ‘feed_links ‘, 2 );
Comments (0)