Shami's Blog

DevOps because uptime is not optional

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:

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

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

 1function drupal_add_feed($url = NULL, $title = '') {
 2  static $stored_feed_links = array();
 3
 4/*  if (!is_null($url)) {
 5    $stored_feed_links[$url] = theme('feed_icon', $url);
 6
 7    drupal_add_link(array('rel' => 'alternate',
 8                          'type' => 'application/rss+xml',
 9                          'title' => $title,
10                          'href' => $url));
11  }*/
12  return $stored_feed_links;
13}

About Me

Dev gone Ops gone DevOps. Any views expressed on this blog are mine alone and do not necessarily reflect the views of my employer.

Categories