"Set role-based permission settings for blog, taxonomy, aggregator, and main site's RSS feeds or disable RSS feeds altogether."

Hi, I'd like to stop the output of the feed and the display of the feed icon completely could someone please tell me how this is done. I've had a look at the readme and for a backend option to disable rss and can't find anything to help me. There is very little documentation.

Many thanks for your time

Comments

desica’s picture

Same question!

kingfisher64’s picture

I really would appreciate a response, as I just can't use the module until one is received.

Many thanks

kingfisher64’s picture

What a waste of time asking. Good job I found out that omega theme has the ability to turn off the display of rss icon. http://drupal.org/project/omega

Use views module to create a blank rss page instead of the rss.xml page

Omega theme > toggle advanced elements > feed icons

This module does say actively maintained. Maybe next to that it should mention that support is not actively given.

Now where's that uninstall button...

fuzzy76’s picture

Disabling the RSS icon will NOT stop Drupal from publishing the feed, you still need this module to prevent the feed from being generated. It's a dangerous way to go if you have sensitive info in your feed.

kingfisher64’s picture

No it will turn off anything only control the output of what's viewable (rss.xml). I'm still not sure on how to use the module. rss.xml page still exists when the module is enabled.

kimu’s picture

Rss permissions module prevent users to access RSS feeds if not specifically authorized.
Omega can do the trick with rss icons. In order to prevent rss alternate links to be published in the head of a page I use this function that has to be added to the template.php file in your theme.

/**
 * Implementation of theme_html_tags
 * Returns HTML for a generic HTML tag with attributes.
 *
 * @param $variables
 *   An associative array containing:
 *   - element: An associative array describing the tag:
 *     - #tag: The tag name to output. Typical tags added to the HTML HEAD:
 *       - meta: To provide meta information, such as a page refresh.
 *       - link: To refer to stylesheets and other contextual information.
 *       - script: To load JavaScript.
 *     - #attributes: (optional) An array of HTML attributes to apply to the
 *       tag.
 *     - #value: (optional) A string containing tag content, such as inline CSS.
 *     - #value_prefix: (optional) A string to prepend to #value, e.g. a CDATA
 *       wrapper prefix.
 *     - #value_suffix: (optional) A string to append to #value, e.g. a CDATA
 *       wrapper suffix.
 */
function YOUR_THEME_html_tag($variables) {
  $element = $variables['element'];
  //remove RSS alternate links from publishing
  if ((isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'alternate') && 
        (isset($element['#attributes']['type']) && $element['#attributes']['type'] == 'application/rss+xml')) {
    return '';
  }
  $attributes = isset($element['#attributes']) ? drupal_attributes($element['#attributes']) : '';
  if (!isset($element['#value'])) {
    return '<' . $element['#tag'] . $attributes . " />\n";
  }
  else {
    $output = '<' . $element['#tag'] . $attributes . '>';
    if (isset($element['#value_prefix'])) {
      $output .= $element['#value_prefix'];
    }
    $output .= $element['#value'];
    if (isset($element['#value_suffix'])) {
      $output .= $element['#value_suffix'];
    }
    $output .= '</' . $element['#tag'] . ">\n";
    return $output;
  }
}
Masala’s picture

Sorry, how to disable RSS completely?

kimu’s picture

No way to disable it completely, you can only prevent alternate links to be published, remove rss icons and in case use RSS permission module to be sure that users without permission don't access your feed pages (if they discover the url).
Doing all this you hide RSS from you site, you don't disable them. Niether users nor feed readers can see them.

Frizus’s picture

this.

function mymodule_menu_alter(&$items) {
unset($items['rss.xml']);
}

highermath’s picture

The dead simple way to do this is to create a view that delivers no content — a core Drupal sitebuilder skill, if ever there was one — and assign it to the url /rss.xml.

excessorize’s picture

It would be even more simple to add a URL alias

Admin > Configuration > URL aliases

or URL redirect (requires redirect module)

Admin > Configuration > URL redirects

pointing to an existing page ... is usually a good bed.

Honestly Illustrated’s picture

Title: Investigate hooks to see if RSS feeds can be disabled fully through module » How to turn off rss completely
Category: feature » support
Status: Needs review » Active

By "turn off completely", the module author is pointing to the fact that you can disallow all roles from being able to access any feeds. Note that this module only has a "Permissions" link in the Modules list, and not a "Configure" link.

The module has only accounted for those RSS feeds which are shown on its own project page.

I found this thread while looking into removing the RSS feeds accompanying Advanced Forum, and of course this module is not the solution: there is another solution, and it should be fairly universal.

Advanced Forum implements its RSS feeds through the Views module, providing each feed as a "display" of the related views, such as "Active topics." To disable these feeds, we simply disable that view display. Then note that the icon and link are part of the "Page" view display.

I dug in and found that these links are coming from templates that are using the core feed icon string builder, with something like:

  <?php if ($feed_icon): ?>
    <div class="feed-icon">
      <?php print $feed_icon; ?>
    </div>
  <?php endif; ?>

We've already seen plenty of "remove it from the theme something.tpl.php" suggestions, but let's go to the root of it, instead: includes/theme.inc

function template_preprocess_page(&$variables) {
...
  $variables['feed_icons']        = drupal_get_feeds();
...
}

function template_preprocess_maintenance_page(&$variables) {
...
  $variables['feed_icons']        = '';
...
}

We simply replicate this same pattern in our own template.php:

/**
 * Override or insert variables into the page template.
 */
function tard_process_page(&$variables) {

  // Cancel all RSS feed icons.
  $variables['feed_icons'] = '';
    
...
}

Then keep an eye out for views that implement feed displays. No more feeds, and no more icons or hyper links. This won't stop Drupal from wasting CPU cycles building the feed icon list, but it will unset the variable without us needing to reimplement the entire template_preprocess_page() hook.

This does not remove the link tag, as in: #1310366: Turn off just the link element and feed icon but keep RSS publishing yet it should, ideally. See also: theming hack to remove feed link and icons

Honestly Illustrated’s picture

Component: Code » Documentation

I'm making this a feature request since the OP relies on a misstatement by the module author on the project page, yet the actual solution lies within the module's scope, but outside of it's current features.

Honestly Illustrated’s picture

Title: How to turn off rss completely » Investigate hooks to see if RSS feeds can be disabled fully through module
Component: Documentation » Code
Category: support » feature
Status: Active » Needs review
Honestly Illustrated’s picture

Title: How to turn off rss completely » Investigate hooks to see if RSS feeds can be disabled fully through module
Component: Documentation » Code
Category: support » feature
Honestly Illustrated’s picture

Issue summary: View changes

better detail

webservant316’s picture

Issue summary: View changes

I hated to install yet another module, especially with the warnings that rss_permissions is use at your own risk. So instead I cleaned up #12 as follows...

function mytemplate_preprocess_page(&$variables) {
  // Cancel all RSS feed icons.
  $variables['feed_icons'] = '';
}

I also set the feed count to 1 at .../admin/config/services/rss-publishing

sillygwailo’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev

I've clarified the project description to take out the bit about disabling RSS feeds altogether.

The module contains code to disable the RSS feed icon if the role does not have permission to view the feed. For example, if it's the main feed, and the user does not have permission to view the main feed, the icon (and link) for the main feed is not displayed.

The code that does this, as of 7.x-1.0-beta1 as well as beta2 is

<?php
/**
 * Overriding theme_feed_icon().
 * Check permission to view the feed before displaying the icon.
 */
function rss_permissions_theme_feed_icon($variables) {  
  if (rss_permissions_feed_url_access($variables['url'])) {
    return theme_feed_icon($variables);
  }  
  return '';
}
?>
Leeteq’s picture