How to Disable RSS feeds on WordPress

How to Disable RSS feeds on WordPress. Using RSS feeds is one way that readers can get the latest news from their favorite sites. Although it’s automatically generated, many bloggers prefer to remove this feature. If you’re thinking of disabling RSS feeds in WordPress, this tutorial might be helpful.

Really Simple Syndication (RSS) or also called Rich Site Summary is a method that allows you to get the latest news and info from the sites you follow. To use it you can use feed reader applications such as Feedly, The Old Reader, or InoReader.

How to Disable RSS feeds on WordPress

If you are using WordPress, the RSS Feed will be created automatically and you can see it in the following links:

http://example.com/?feed=rss
http://example.com/?feed=rss2
http://example.com/?feed=rdf
http://example.com/?feed=atom

In addition to post updates, RSS Feed will also create feeds for categories, tags, comments, etc.

Although it makes it easier for bloggers to send updates to readers, quite a few consider RSS to be a less effective method of disseminating info from your site to readers. Besides, you may not need RSS Feeds if you have a static website.

Disabling RSS Feeds in WordPress

There are two different ways to disable RSS feeds in WordPress. You can either use a plugin or do it manually by adding your own code.

1. Disabling RSS Feeds with Plugins

The first way to disable RSS feeds on WordPress is to use a free plugin like Disable Feed. This method is perfect for bloggers who don’t want to bother because you only need to install it and this plugin will automatically disable RSS / Atom / RDF Feeds.

The only settings menu available can be seen in the Settings >> Reading menu.

How to Disable RSS feeds on WordPress

For the default option ‘Redirect feed request to corresponding HTML content’, readers who want to access your site’s RSS Feed will be directed directly to your site. For example, if a user wants to access the category feed, they will be redirected to your site’s category page, etc.

Conversely, the ‘Issue a Page Not Found (404) error for feed requests’ option will redirect users to a 404 error page.

One other option is ‘Do not disable the global post feed and global comment feed’ for those of you who still want to disable all feeds other than the post feed and comment feed only.

Read: How to Open Webp Files in Photoshop Easily

And in addition to regular blogs, this plugin can also disable RSS feeds on web forums that use BuddyPress and bbPress.

2. Disabling RSS Feeds with Code

The second method to disable WordPress RSS feeds is to add a few lines of code to the functions.php file.

But remember, editing WordPress theme files like functions.php can break your site if not done correctly. So don’t forget to do a backup first or use a code snippet plugin so that your changes don’t affect the original file.

To turn off the RSS Feed feature on a WordPress website, simply add the following code to the functions.php file.

function bb_disable_feed() {
 wp_die( __( 'No feed available, please visit the <a href="'. esc_url( home_url( '/' ) ) .'">homepage</a>!' ) );
}
add_action('do_feed', 'bb_disable_feed', 1);
add_action('do_feed_rdf', 'bb_disable_feed', 1);
add_action('do_feed_rss', 'bb_disable_feed', 1);
add_action('do_feed_rss2', 'bb_disable_feed', 1);
add_action('do_feed_atom', 'bb_disable_feed', 1);
add_action('do_feed_rss2_comments', 'bb_disable_feed', 1);
add_action('do_feed_atom_comments', 'bb_disable_feed', 1);

Now if someone visits the RSS feed on your site then they will see the message in the code above.

How to Disable RSS feeds on WordPress

To replace the message with your own, simply change the code on the second line.

Thus is a little tutorial tips and tricks how to disable rss feed on wordpress