How To Disable RSS Feeds In WordPress

Do you really want to disable RSS feeds in WordPress? Here’s why. Some folks are creating auto blogs and fetching contents from our blog through the RSS feed URL. By default, WordPress RSS feed URL will look like www.example.com/feed/.

Nobody likes redistributing our content without any notice or something. It will affect your website’s ranking, SEO and revenue. By disabling the RSS feed URL, you can prevent content theft. In this post, we are going to show you how can you disable RSS feeds in WordPress without getting any error.

How To Disable RSS Feeds In WordPress

There are two methods available.

  • Using the Disable Feeds.
  • Code
  • Perfmatters Plugin.

Both are simple and will work without getting any error. We will explain both below. Choose one which you prefer.

Plugin Method

You need to install the Disable Feeds plugin.

https://wordpress.org/plugins/disable-feeds/

After installing the plugin, activate it.

Disable RSS Feeds In WordPress

Under your WordPress reading settings, you can see the plugin settings. For disabling the feed, all you need to is, simply redirect all those feed requests to a 404 error page.

disabling RSS feeds using WordPress plugin

So when someone tries to access your feed, they will see a page not found.

feed URL not found error

Coding Method

If you don’t want to use a plugin, this method is for you. Simply copy the below code.

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

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

Add the code on your theme’s functions file. Make sure that you are using a WordPress child theme. Update the functions file.

disabling RSS feed code

Check your RSS feed from the front end. It will be disabled.

rss feed disabled on wordpress

Now, let’s look at how we can disable the RSS feed using the Perfmatters plugin.

Using Perfmatters Plugin

Perfmatters is a premium WordPress optimization and hardening plugin. The plugin for several options for optimizing your blog and making it secure. In that list, you can see an option to disable RSS feeds.

perfmatters plugin rss feed settings

Simply enable the option and update the plugin settings. That’s how it’s done!

Troubleshooting

If you didn’t see that your RSS feed still showing contents, it’s a problem with caching. You can try accessing the feed URL on any private window or using a proxy site.

We hope you enjoyed the read and found it helpful. If you did, please consider sharing this post with your friends and fellow bloggers. For more related posts, you should check out our blog.

Leave a Comment