How to disable rss ?
-
RSS feed for this topic – is there a way to auto disable this or do we have to extract it ourselves
-
It is built into the code. You could disable the ‘call’ for the feed in topic.php if you really wanted to and/or the files that generate it (rss.php, etc)!
Trent
I am looking for a generalized way to stop all feeds from BBPress.
Is there a core file I can delete? I deleted register.php to prevent any user registrations (and removed any links to it). Where is the ‘beating heart’ of the RSS so I can rip that out too?
Note – I was using the private categories plugin which did this nicely but I have migrated to Amember and am coding the security right into the theme.
Since it sounds like you’re heavily modifying your install, I suppose you don’t have a problem modifying core files. It makes upgrading to a new version of bbPress more difficult, but you’ve already started down that road.
How about just changing bb-includes/template-functions.php and modifying what the bb_feed_head function returns (i.e. make it return no rss links at all.) I don’t know if that takes care of everything or not. Maybe it just kills autodiscovery of feeds. But I think in that file is where you would make the changes you want to disable RSS altogether.
There are rss links in the template files as well, so you should remove those too, so they don’t appear. I think a combination of removing the links from the template and the rss links from the <head> would take care of it.
Also, I imagine there is a way with a plugin to remove the rss feed links, to avoid modifying core files. I just don’t know how to do that (add a plugin to remove links in the <head>.)
The most important thing is that I remove the ability to get RSS. Removing autodiscovery is a secondary issue. The template files are easy to modify, I am not worried about that. The private forums plugin did a good job and there is very limited code in there dedicated to RSS. There must be a way to just shut it down with a simple filter plugin.
Why not just remove the links to the RSS feeds that appear in the template files? Doesn’t that accomplish what you want?
Like in topic.php in your template you have this link:
<a href="<?php topic_rss_link(); ?>
Just remove that, and remove links like it from the other template files. What am I missing?
Would this prevent someone from hitting http://yoursite.com/forums/feed and getting a response? I assumed it would not.
I deleted rss.php (just as I did register.php) from the core. I suppose deleting core files isn’t as bad as editing them, though I don’t like the solution. I also am in the process of editing the theme.
I found a better solution. I kept rss.php in the core and edited the rss2.php file in my theme to display titles, authors, time, etc but not post content. This was the perfect solution for me.
awesome… this is exactly what I need to do myself. Thanks for the solution.
It’s been about a year since you implemented this… has it worked out well? would love to hear some recent discussion on the topic.
I’ve found the following works well in functions.php
function disable_our_feeds() {
wp_redirect(get_option('siteurl'));
}
add_action('bbp_feed', 'disable_our_feeds', 1);
i think you have to search plugin for bbpress. or this link will use http://flatpress.org/vanilla2/discussion/848/how-to-safely-securely-disable-rss-feeds/p1
Open your functions.php located inside your themes folder and add the subsequent code:
function fb_disable_feed() {
wp_die( __(‘No feed available,please visit our homepage!’) );
}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);Once you add this code, anytime somebody tries to succeed in your feeds, they’ll see this message: “No feed on the market, please visit our homepage.” you’ll modification the message to suit your wants.
- You must be logged in to reply to this topic.