Skip to:
Content
Pages
Categories
Search
Top
Bottom

Removing ‘Global RSS Feed’

  • Avatar of xxx
    xxx
    Participant

    @pixelflat

    Just a simple question:
    How can I remove the Global RSS Feed (`bp_activity_sitewide_feed`) not their links in `bp_head` i mean the feed itself. So when you go to example.com/activity/feed you will be redirected to the 404.php page..

Viewing 12 replies - 1 through 12 (of 12 total)
  • Avatar of Paul Gibbs
    Paul Gibbs
    Keymaster

    @djpaul

    remove_action( ‘bp_head’, ‘bp_activity_sitewide_feed’ );

    Perhaps in your theme’s functions.php, hooked in the after_setup_theme action.

    Avatar of xxx
    xxx
    Participant

    @pixelflat

    @djpaul Well, your code will remove just the RSS Link in the browser, but not the feed itself.. any idea for a function that makes `bp_core_redirect` work?

    Avatar of aces
    aces
    Participant

    @aces

    I use:
    `
    function bp_remove_feeds() {
    remove_action( ‘bp_actions’, ‘bp_activity_action_sitewide_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_personal_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_friends_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_my_groups_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_mentions_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_favorites_feed’, 3 );
    remove_action( ‘groups_action_group_feed’, ‘groups_action_group_feed’, 3 );
    }
    add_action(‘init’, ‘bp_remove_feeds’);
    `
    in functions.php

    Avatar of xxx
    xxx
    Participant

    @pixelflat

    @aces Looks like it’s not woking in 1.6

    Any idea how to do a `bp_core_redirect` maybe to 404.php?

    @djpaul

    My code:
    `function disable_feed() {

    bp_core_redirect(get_option(‘siteurl’));
    }
    add_action(‘bp_activity_sitewide_feed’, ‘disable_feed’, 1);`

    is not working…

    Avatar of xxx
    xxx
    Participant

    @pixelflat

    @djpaul

    `function redirect_feed() {

    header( ‘Location: http://example.com‘ ) ;
    }
    add_action(‘bp_activity_sitewide_feed’, ‘redirect_feed’, 1);`

    Is also not working…
    I think you need to overwrite a core function, to make it work.

    Avatar of Maruti Mohanty
    Maruti Mohanty
    Participant

    @marutim

    I am having the same problem … I am using Bp 1.6.1. Can someone pls help?
    How can i disable the Buddpress Rss feeds..
    Solution by @aces doesnt work.

    Any help will be highly appreciated.

    Thanks in Advance.

    Avatar of aces
    aces
    Participant

    @aces

    hmmn… it still works for me but only for the activity feed ( excluding the ` lines which weren’t converted to the new bp forum format ). It used to work for members as well.

    To disable all feeds I just tried the following from http://wordpress.stackexchange.com/questions/33072/how-to-remove-feeds-from-wordpress-totally
    :

    /**
    * disable feed
    */
    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);

    Which worked for me to disable All feeds to everyone. It’s a bit unsubtle but does plug the security hole….

    Avatar of Maruti Mohanty
    Maruti Mohanty
    Participant

    @marutim

    @aces I have used http://wordpress.stackexchange.com/questions/33072/how-to-remove-feeds-from-wordpress-totally but this works only for the WP pages and not for the BP pages.
    then i used
    function bp_remove_feeds() {
    remove_action( ‘bp_actions’, ‘bp_activity_action_sitewide_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_personal_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_friends_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_my_groups_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_mentions_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_favorites_feed’, 3 );
    remove_action( ‘groups_action_group_feed’, ‘groups_action_group_feed’, 3 );
    }
    add_action(‘init’, ‘bp_remove_feeds’);

    But still I can see the feeds for the activity page :(

    Any help will be highy appreciated?

    Anyways @aces thanks for responding :)

    Avatar of @ChrisClayton
    @ChrisClayton
    Participant

    @chrisclayton

    You could use the die function that @aces provided but hook it to the BuddyPress actions (for site side feeds that’s ‘bp_activity_sitewide_feed’)

    Eg.
    add_action('bp_activity_sitewide_feed', 'fb_disable_feed', 1);

    Avatar of Maruti Mohanty
    Maruti Mohanty
    Participant

    @marutim

    @chrisclayton I have used that but still i could still see the feeds with a url like sitename/activity-page/feed

    I am using the following in the functions.php


    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 );
    add_action( 'bp_activity_sitewide_feed', 'fb_disable_feed', 1 );
    add_action( 'bp_activity_personal_feed', 'fb_disable_feed', 1 );
    add_action( 'bp_activity_friends_feed', 'fb_disable_feed', 1 );
    add_action( 'bp_activity_my_groups_feed', 'fb_disable_feed', 1 );
    add_action( 'bp_activity_mentions_feed', 'fb_disable_feed', 1 );
    add_action( 'bp_activity_favorites_feed', 'fb_disable_feed', 1 );
    add_action( 'groups_group_feed', 'fb_disable_feed', 1 );

    function fb_disable_feed() {

    wp_die( __( 'No feed available,please visit our homepage!' ) );

    }

    The above codes doesnt seem to work … FYI i am using BP 1.6.1 and WP 3.4.2

    Avatar of @ChrisClayton
    @ChrisClayton
    Participant

    @chrisclayton

    @marutim – sorry, should have mentioned that i didnt actually test it when i posted that but i just tried it on a site and it seems to work, and I can’t see anything wrong with the code you posted.
    Not sure why its not working for you.

    You could try outputting a “>”; since I just noticed its killing the page after the feed header’s started and it doesn’t close the HTML, but If your browser was sensitive to bad html you still shouldn’t have seen feed as wp would have killed it… So I don’t think its that…

    Avatar of Maruti Mohanty
    Maruti Mohanty
    Participant

    @marutim

    Thanks @chrisclayton for stopping by and replying

    Can any one help me on this? :(

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.