Reputation: 237
I have just set up a new Drupal site, community based. there are some forums which contain 'sensitive' info, yet incredibly, Drupal auto generates RSS feeds for taxonomy terms, which is what the forum is based on.
There's no built in way to turn it off! Or a module to control what feeds are generated... this is a big problem.
Using Drupal 6.14. I dont want to hack core but if anyone knows a way to deal with this... that would be great
Thanks
Upvotes: 4
Views: 9630
Reputation: 56
There's a Drupal module now, that does that: RSS Permissions. Here is an excerpt from its project page:
Set role-based permission settings for blog, taxonomy, aggregator, and main site's RSS feeds. This module does not disable RSS feeds altogether: RSS feeds created through the Views module and others not listed here do not have associated permissions.
RSS permissions module lets you disable some or all RSS feeds based on different user roles,
Upvotes: 4
Reputation: 11
This works in a custom module. It will remove the page and also the link in the HTML for the page, this is for D7. Make sure you flush your caches.
function MYMODULE_menu_alter(&$items) {
$items['rss.xml']['page callback'] = 'drupal_not_found';
}
function MYMODULE_html_head_alter(&$head_elements) {
foreach ($head_elements as $key => $v) {
if (strstr($key, 'rss.xml')) {
unset($head_elements[$key]);
}
}
}
Upvotes: 1
Reputation: 11
You could extend the list of values of "options" in the form section in system_rss_feeds_settings function in system.admin.inc - add '0' as a value in the array. This will then expose 0 as a value of "Number of items in each feed", thereby suppressing the RSS feed generation.
Upvotes: 1
Reputation: 19441
If you are using the Views module, you could enable the taxonomy_term
override it offers and edit the two feed displays it provides, adjusting them to work only for certain vocabularies, or even force a 404 for any request.
Note that this would just be a variation of ceejayoz' (correct) suggestion, as the view would 'take over' the feed URLs and serve something differently for them.
Upvotes: 5
Reputation: 179994
You could try a hook_menu
call in a custom module that takes over the sensitive URLs and serves a blank page or error message. Turning them off should be in core, and a Google search shows a lot of grumpy people over the issue.
Upvotes: 6