Disable RSS Feeds Without Plugin in WordPress

Disable RSS Feeds Without Plugin to stop unwanted scraping and tighten your WordPress site security. Here’s how to disable feeds manually using your child theme.

Step 1: Add the RSS Feeds Disable Code

Add this code to your child theme’s functions.php:


function qdt_disable_rss() {
  wp_die( __(‘No feed available. Please visit our homepage!’) );
}
add_action(‘do_feed’, ‘qdt_disable_rss’, 1);
add_action(‘do_feed_rdf’, ‘qdt_disable_rss’, 1);
add_action(‘do_feed_rss’, ‘qdt_disable_rss’, 1);
add_action(‘do_feed_rss2’, ‘qdt_disable_rss’, 1);
add_action(‘do_feed_atom’, ‘qdt_disable_rss’, 1);

How It Works

This snippet blocks all RSS feed endpoints and displays a simple message instead of the feed content.

Why Disable RSS Feeds Without Plugin?

If you don’t run a blog that needs RSS, disabling feeds reduces scraping, spam bots and unused endpoints that can be exploited.

Common Mistake

Some syndication tools or feed readers depend on RSS. Make sure you don’t use any before disabling feeds completely.

Pro Tip

Use a child theme for this tweak to ensure it stays safe after updating your main theme.

Related Snippet

If you liked this, check out my guide on disabling the Heartbeat API without a plugin in WordPress.

Leave a Comment