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 →
PureMag PRO WordPress Theme

PureMag PRO

If you like PureMag free WordPress Theme, you will love the premium version. PureMag PRO is an user friendly, HTML5/CSS3...

$25.00
GridMode PRO WordPress Theme

GridMode PRO

Are you using the GridMode free WordPress Theme and looking for more advanced features? GridMode PRO theme is developed for...

$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
GridBone PRO WordPress Theme

GridBone PRO

$25.00
GridFlex PRO WordPress Theme

GridFlex PRO

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

$25.00
GridRead PRO WordPress Theme

GridRead PRO

If you like GridRead Free WordPress Theme, then you will love the premium version. GridRead PRO version has color options,...

$25.00
GridFeel PRO WordPress Theme

GridFeel PRO

$25.00
MagPal PRO WordPress Theme

MagPal PRO

$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 56 WordPress themes.