
How to Remove a BuddyPress Profile Tab Item
- November 5, 2015
- Leave a comment
For developing a social network on your WordPress website, BuddyPress is the best choice. Sometimes, you may need to change its Profile Tab Items. Several hooks are available to remove a tab from existing BuddyPress profile tabs.
For example if you want to remove messages tab, add the following code:
1 2 3 4 5 |
function bp_remove_messages_from_profile() { bp_core_remove_nav_item('messages'); } add_action('bp_messages_setup_nav','bp_remove_messages_from_profile'); |
Similarly, if you want to remove activity then you will use bp_activity_setup_nav hook instead of bp_messages_setup_nav:
1 2 3 4 5 |
function bp_remove_activity_from_profile() { bp_core_remove_nav_item('activity'); } add_action('bp_activity_setup_nav','bp_remove_activity_from_profile'); |
much appreciated, for some reason all of the codes I find for this are dated and dont work for me…however…for some reason I can only use one of these functions at a time or it crashes my site. I’m not sure why it would.
Hi Andrew,
If you want both actions to be fired then please write the following code:
function bp_remove_item_from_profile()
{
bp_core_remove_nav_item(‘activity’);
bp_core_remove_nav_item(‘messages’);
}
add_action(‘bp_activity_setup_nav’,’bp_remove_item_from_profile’);
Thank you for writing to us. Let us know if you need any further assistance.
Thanks & Regards,
PressTigers
Hi, I’m trying to remove “profile ” under member. They don’t want their personal info in public. Any thoughts? Thanks.