Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disable All RSS Feeds – update


  • Oscar Estepa
    Participant

    @estepix

    Hi,

    I have a site using buddypress 2.4.3 where all buddypress functionality must be private (requires login) while the blog part is public.

    The problem is that the Activity feed was being crawled by feedly and other services, thus breaking our users privacy.

    Searching on google I found out this topic:

    https://buddypress.org/support/topic/disable-all-rss-feeds/

    And when trying to apply the fix I realised the code was outdated, therefore I leave here the updated code:

    
    function cherrypick_custom_bp_remove_feeds(){
    	remove_action('bp_actions', 'bp_activity_action_sitewide_feed');
    	remove_action('bp_actions', 'bp_activity_action_personal_feed');
    	remove_action('bp_actions', 'bp_activity_action_friends_feed');
    	remove_action('bp_actions', 'bp_activity_action_my_groups_feed');
    	remove_action('bp_actions', 'bp_activity_action_mentions_feed');
    	remove_action('bp_actions', 'bp_activity_action_favorites_feed');
    	remove_action('bp_actions', 'groups_action_group_feed');
    }
    add_action('init', 'cherrypick_custom_bp_remove_feeds');
    

    And on pastebin:

    http://pastebin.com/zaiGH4Dr

    I can confirm it is working fine on:

    • WordPress 4.4.2
    • BuddyPress 2.4.3

    Hope this is helpful!

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

  • @mcuk
    Participant

    @mcuk

    Thanks @estepix,

    Any ideas why the WP hook wasn’t working for this?

    (My site not live yet so unable to test, but been looking into the search engine etc site crawling for when it is)


    Oscar Estepa
    Participant

    @estepix

    No particular reason, Buddypress 2.4.3 is using ‘bp_actions’ hook to add its actions instead of ‘wp’ and according to WordPress you need to use the exact same hook with the exact same priority in order to remove a previously inserted action, i.e., now BuddyPress is adding its functions as:

    add_action('bp_actions', 'bp_activity_action_sitewide_feed');

    See wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php (L530).

    Therefore, they need to be removed using the exact same syntax:

    remove_action('bp_actions', 'bp_activity_action_sitewide_feed');


    @mcuk
    Participant

    @mcuk

    Ahhh thanks @estepix!


    Oscar Estepa
    Participant

    @estepix

    No problem! hope it helps!!!


    michaelroed
    Participant

    @michaelroed

    Does this only remove the RSS functions or also the visible RSS link seen at the front end? Reason for asking is that I have put this code in my functions.php but nothing has happend at the front end.
    I was looking to remove the RSS link in the groups but it is still there?!


    danbp
    Moderator

    @danbp

    The function is working but doesn’t remove the RSS buttons.
    You can hide them with CSS. Something like .feed {display:none!important;}


    michaelroed
    Participant

    @michaelroed

    Perfect.
    Thank you.


    autox420
    Participant

    @autox420

    Where do i add this code?


    michaelroed
    Participant

    @michaelroed

    In your custom functions.php file

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar