Saturday 26 January 2013

Disable Wordpress Feed

How to disable feed in wordpress ?

Sometime we don't require feed and we want to remove from wordpress site/blog.
Here I show you, how to remove wordpress feed.

To remove wordpress feed from your wordpress website you have to copy following code into your function.php file.

  • *
  • * disable all type of feed
  • */
  • function fb_disable_feed() {
  • wp_die( __('Sorry...!!! No feed available,please visit our <a href="'. get_bloginfo('url') .'">Website/Blog</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);

Above code is not delete the feed or url for feed, when some one visit the feed url of your websit it will show message like "Sorry...!!! No feed available, please visit our website/blog", which is write in above code.


No comments:

Post a Comment