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

WP Masonry PRO

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

$25.00
GridShow PRO WordPress Theme

GridShow PRO

GridShow PRO WordPress theme is a feature-rich, advanced version of GridShow Free WordPress Theme. GridShow PRO version has color and...

$25.00
Simple Grid PRO WordPress Theme

Simple Grid PRO

You'll be pleased with the Simple Grid PRO WordPress theme if you have tried the free version. It is a...

$25.00
GridLane PRO WordPress Theme

GridLane PRO

If you like the free version of GridLane WordPress Theme, you'll love the premium version even more. It will help...

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

GreatWP PRO

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

$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.