Get Rid Off From Non Essential WordPress RSS Feeds

By default WordPress automatically generates RSS feed for every post type, tag, category and other archive types. This results in unnecessary load on your website.

In this lesson we will show you how you can disable all unnecessary RSS feeds and promote your main RSS. 

All you got to do is open your theme’s function.php file (located in your site’s root wp-content -> themes -> enabled theme directory) and add the given lines:

remove_action( ‘wp_head’, ‘feed_links’, 2 );
remove_action( ‘wp_head’, ‘feed_links_extra’, 3 );

Given code removes all other feeds and promotes main RSS of your website.

If you like doing something more powerful the go for this function:

function fb_disable_feed() {
wp_die( __(‘No feed available,please visit our <a href=”‘. get_bloginfo(‘url’) .’”>homepage</a>!’) );

add_action(‘do_feed’, ‘fb_disable_feed’, 1);
add_action(‘do_feed_rdf’, ‘fb_disable_feed’, 1);
add_action(‘do_feed_rss’, ‘fb_disable_feed’, 1);
add_action(‘do_feed_rss2′, ‘fb_disable_feed’, 1);
add_action(‘do_feed_atom’, ‘fb_disable_feed’, 1);

Plugin users may refer to this lesson. It explains you how you can disable RSS completely off from your website.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.