How to Disable RSS Feeds in WordPress

Would you like to turn off RSS feeds on your WordPress site? People can subscribe to your blog posts with RSS feeds. But if you're making a small, static website, you might want to turn off the RSS feeds. WordPress doesn't have a way to get rid of RSS feeds by default.

By adding the below code snippet to your functions.php file, you can disable all the feed addresses and remove feed links from the header.

// A message to display instead of the feeds.
function themesdna_disable_feed() {
    wp_die(
        sprintf(
            // Translators: Placeholders for the homepage link.
            esc_html__( 'No feed available, please visit our %1$shomepage%2$s!' ),
            ' <a href="' . esc_url( home_url( '/' ) ) . '">',
            '</a>'
        )
    );
}

// Replace all feeds with the message above.
add_action( 'do_feed', 'themesdna_disable_feed', 1 );
add_action( 'do_feed_rdf', 'themesdna_disable_feed', 1 );
add_action( 'do_feed_rss', 'themesdna_disable_feed', 1 );
add_action( 'do_feed_rss2', 'themesdna_disable_feed', 1 );
add_action( 'do_feed_atom', 'themesdna_disable_feed', 1 );
add_action( 'do_feed_rss2_comments', 'themesdna_disable_feed', 1 );
add_action( 'do_feed_atom_comments', 'themesdna_disable_feed', 1 );

// Remove links to feed from the header.
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );

Our WordPress Themes

Below are some of our premium WordPress themes. View all our free and premium WordPress themes →
GridMini PRO WordPress Theme

GridMini PRO

Do you like the free version of the GridMini WordPress theme? But what if you need more features and options?...

$25.00
EliteWP PRO WordPress Theme

EliteWP PRO

If you like EliteWP free WordPress Theme, you will love the premium version. EliteWP PRO is an advanced, very user...

$25.00
BestWP PRO WordPress Theme

BestWP PRO

If you like BestWP free WordPress Theme, you will love the BestWP premium version. BestWP PRO is user friendly, feature-rich,...

$25.00
GridNext PRO WordPress Theme

GridNext PRO

If you have used GridNext Free WordPress Theme, then you will love the premium version. GridNext PRO version has color...

$25.00
GridMag PRO WordPress Theme

GridMag PRO

If you like GridMag free WordPress Theme, you will love the premium version. GridMag PRO is an improved version of...

$25.00
PrimeWP PRO WordPress Theme

PrimeWP PRO

If you like PrimeWP Free WordPress Theme?, Then you will love the premium version. PrimeWP PRO is an more improved...

$25.00
BlogWP PRO WordPress Theme

BlogWP PRO

If you like BlogWP free WordPress Theme, you will love the premium version. BlogWP PRO is easy to use, feature-rich,...

$25.00
GridMax PRO WordPress Theme

GridMax PRO

GridMax PRO is a feature-rich, advanced WordPress theme than its free version. If you like GridMax Free WordPress Theme, then...

$25.00

Can't you choose a single theme? Purchase All Themes for $75.

Save money with our low, one-time price for access to all of our 55 WordPress themes.