@tse11
try replacing the ‘wp’ with ‘bp_actions’
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('bp_init', 'bp_remove_feeds');
@aces Thanks much, that was a great idea. Unfortunately it didn’t work. There has got to be a way to at least make these feeds private. If anyone knows, please let me know.
@tse11
Use init hook instead of bp_init! Place in bp-custom.php :
https://codex.buddypress.org/plugindev/bp-custom-php/
function pcfbp_lite_cut_nonreg_visitor_rss_feed() {
if ( !is_user_logged_in() ) {
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', 'pcfbp_lite_cut_nonreg_visitor_rss_feed');
Make sure the single quotes are not being modified if you are copying and pasting the code!
@bphelp Thanks, unfortunately that didn’t work either.
For anyone wondering. I found a plugin that finally blocks the BP feeds. It is for wordpress but did the trick. The plugin is here:
https://wordpress.org/plugins/disable-feeds/
@bp-help … thank you for the code snips but can you clarify the last remove action is correct … e.g., remove_action( 'groups_action_group_feed', 'groups_action_group_feed',3 );
shouldn’t this be use the bp_actions thus instead be this – remove_action( 'bp_actions', 'groups_action_group_feed',3 );
..??..
also, i noticed that with respect to bbPress, the topics and contents show in the feed – e.g., site.com/forums/feed/ shows the feed titles with some content (maybe excerpt or maybe full text not sure as my test site only has one liners) …
accordingly, how can we hide the forum feeds … e.g., i thought maybe adding lines like this might work but they did not –
remove_action( 'bp_actions', 'bbp_display_topics_feed_rss2',3 );
remove_action( 'bp_actions', 'bbp_display_replies_feed_rss2()',3 );
thanks in advance for any pointers you can share – especially with blocking bbPress Forum Topic contents – site.com/forums/feed/ … cordially, chuck scott