Skip to:
Content
Pages
Categories
Search
Top
Bottom

Removing ‘Global RSS Feed’


  • 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)
  • remove_action( ‘bp_head’, ‘bp_activity_sitewide_feed’ );

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


    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?


    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


    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…


    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.

    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.


    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….

    @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 🙂


    @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);

    @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


    @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…

    Thanks @chrisclayton for stopping by and replying

    Can any one help me on this? 🙁

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Removing ‘Global RSS Feed’’ is closed to new replies.
Skip to toolbar