RSS feeds allow your website visitors to subscribe to your blog posts. However, not all sites require RSS feeds.
You can disable the RSS feeds in WordPress if you own a static website or don’t have blog posts. WordPress doesn’t offer an option to turn off the RSS feeds.
You can use the below code to remove the RSS feeds of your WordPress website.
php
/**
* Disable RSS feeds in WordPress
*/
function unmaskwp_disable_feeds()
{
wp_die(__('No feed available, please visit the <a href="' . esc_url(home_url('/')) . '">homepage</a>!'));
}
add_action('do_feed', 'unmaskwp_disable_feeds', 1);
add_action('do_feed_rdf', 'unmaskwp_disable_feeds', 1);
add_action('do_feed_rss', 'unmaskwp_disable_feeds', 1);
add_action('do_feed_rss2', 'unmaskwp_disable_feeds', 1);
add_action('do_feed_atom', 'unmaskwp_disable_feeds', 1);
add_action('do_feed_rss2_comments', 'unmaskwp_disable_feeds', 1);
add_action('do_feed_atom_comments', 'unmaskwp_disable_feeds', 1);