Connect with us

Disable RSS Feeds in WordPress | Turn Off Feeds using Plugin/Editing Theme

solution

Disable RSS Feeds in WordPress | Turn Off Feeds using Plugin/Editing Theme

Have you not yet found a way to disable RSS Feeds in WordPress? You need not go through all the WordPress Settings pages to find an option to disable the feeds. Because by default in WordPress there is no option to disable/remove RSS feeds. So, read the complete article and know how to turn off RSS Feeds in WordPress.

What are RSS Feeds and Why should I disable feeds?

Feeds (RSS/Atom/RDF feeds) are useful if you have a site with regularly updated content like blog posts, comments, etc. With these feeds people can subscribe to those updates without visiting your website. These RSS feeds are essential for dynamic sites because they contain a regularly updated content. However, in some cases when you maintain a static site, you may not need the RSS feeds because there will be no much updates for the people to subscribe. So here you may want to remove the RSS Feeds through which you can save some time in managing your website. Also, for the site which requires more security, you may want to Disable feeds.

How to Disable RSS Feeds in WordPress?

To help you know how to delete RSS Feeds in WordPress, we have provided two simple solutions. Both are simple but one requires a plugin, and other requires code. In first method, you need to install a ‘Disable Feeds’ plugin and in second method you need to add a code to theme’s functions.php file. Check the 2 solutions and use the method you are comfortable with.

Method 1: Disable RSS Feeds Using a Plugin

Method 2: Disable Feeds in WordPress by Editing Theme

Disable RSS Feeds Using Plugin

In this method, you can stop RSS Feeds in your WordPress site using a Plugin named ‘Disable Feeds’. This allows you to disable all RSS/Atom/RDF feeds on your site. It is mainly useful for the site builders who use WordPress purely as a CMS (content management system).

  • In the WordPress Plugins section, click on Add New and search for ‘Disable Feeds’ and click on ‘Install Now’ as shown below.
  • On clicking that, you will direct to the ‘Installing Plugin: Disable Feeds 1.4.2’ section.
  • Click on ‘Activate Plugin’ and activate the Disable Feeds plugin as shown below.
  • On activation, click on ‘Reading’ in the Settings section as shown below.
  • There you can configure the ‘Disable Feeds Plugin’.
  • By default, the plugin redirects the feed requests to the related HTML content on your site. For example, if the user requested a category feed then he will be redirected to the category page. If users requesting a custom post type RSS feed then they will be redirected to the custom post type archive.
  • You can change this default settings and display a Page Not Found (404) error for the user feed requests.
  • It also gives the option not to disable the global post feed and global comment feed. This makes the user to still read your RSS feed, but there will be no other feeds like individual post comments, archives, search, category, etc.
  • On selecting the required option click on ‘Save Changes’ button.

Disable RSS Feeds in WordPress by Editing Theme

With this method, you can disable feeds without installing plugins on your WordPress site. So, if you don’t like adding functions through plugins you can edit your theme files.

To disable all feeds manually, you need to add the following code to your theme’s functions.php file or a site-specific/ empty plugin and activate that plugin. This code will disable all the RSS/RDF/Atom feeds on your WordPress site.

function wp_disable_feed() {
wp_die( __('No feed available,please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!') );
}

add_action('do_feed', 'wp_disable_feed', 1);
add_action('do_feed_rdf', 'wp_disable_feed', 1);
add_action('do_feed_rss', 'wp_disable_feed', 1);
add_action('do_feed_rss2', 'wp_disable_feed', 1);
add_action('do_feed_atom', 'wp_disable_feed', 1);
add_action('do_feed_rss2_comments', 'wp_disable_feed', 1);
add_action('do_feed_atom_comments', 'wp_disable_feed', 1);

This code prevents anyone from accessing a feed action. When the user requests an RSS feed, it simply redirects him to an error page in which it gives the option to visit your homepage as shown below.

Note: Before adding the above code to your theme’s functions.php file, don’t forget to back up your theme because on any unexpected issues your website design may break. And also, make sure to add the code in the child theme.

Conclusion

For the site builders who wants to maintain a dynamic site which is regularly updated, these RSS feeds are useful. The people can easily subscribe to those updates. However, for static sites the developer may not require the RSS feeds. So for them it is better to Disable the feeds in WordPress site.

If you are a WordPress Beginner use the first method i.e. ‘Disable RSS Feeds Using Plugin’. Because this is the easy way which disables RSS Feeds in WordPress within few steps without using any code.

If you don’t like installing plugins to your WordPress site, you can try second method i.e. editing your theme files to disable RSS feeds. You can use this method if you feel secure pasting code snippets from the web into your WordPress site. This method is recommended for the site builders who have an idea about coding theme’s functions.php file.

Continue Reading
2 Comments

2 Comments

  1. oliver

    08/04/2020 at 21:00

    I want to thank you, that worked flawlessly to selectively disable atom and rdf feeds, while leaving the rest alive, just choosing which add_action lines to remove or keep.

    You helped someone who needed it 🙂

Leave a Reply

Cancel reply

Your email address will not be published. Required fields are marked *

More in solution

About Me:

Szabi Kisded

Hey there, I'm Szabi. At 30 years old, I quit my IT job and started my own business and became a full time WordPress plugin developer, blogger and stay-at-home dad. Here I'm documenting my journey earning an online (semi)passive income. Read more

Sign up for my newsletter and get the YouTube Caption Scraper WordPress plugin for free
(worth 29$)!

All My Plugins In A Bundle:

My AutoBlogging Plugins:

My Online Courses:

A Theme I Recommend:

Featured Posts:

To Top