Home > Technical > Disabling RSS Feeds in Drupal 5.x

Disabling RSS Feeds in Drupal 5.x

You might want to create a site that doesn’t have RSS. I did this for my employer to create the admission exam system. Having the RSS icons show up just annoyed me, here is how to do it:

In theme.inc, just comment all the code lines in this function:

function theme_feed_icon($url) {
//  if ($image = theme('image', 'misc/feed.png', t('Syndicate content'), t('Syndicate content'))) {
//    return '<a href="'. check_url($url) .'" class="feed-icon">'. $image. '</a>';
//}
}

In common.inc do the same with this function except for the first and last lines:

function drupal_add_feed($url = NULL, $title = '') {
  static $stored_feed_links = array();

/*  if (!is_null($url)) {
    $stored_feed_links[$url] = theme('feed_icon', $url);

    drupal_add_link(array('rel' => 'alternate',
                          'type' => 'application/rss+xml',
                          'title' => $title,
                          'href' => $url));
  }*/
  return $stored_feed_links;
}
Categories: Technical Tags: , ,
  1. srinivas
    December 4th, 2008 at 16:10 | #1

    i need to completely disable the rss

    1. after following ur steps, i tried landing to the rss url directly and it was working.. eg: http://www.abc.com/q?=rss.xml

    2. mozilla still shows the rss symbol and when i click on it it takes me to the feed.. so want to disable it completely..

    ur help will b much appreciated

  2. Mohammad Al-Shami
    December 21st, 2008 at 08:48 | #2

    Sorry for the late reply. I don’t check my mailbox during vacation.

    This code segment should only disable the RSS link from being included in the main page. The RSS feed is still created. Maybe you could set your web server to block connections to q?=rss.xml

  1. No trackbacks yet.