# BuddyPress: Remove Profile Tabs You Don't Need

> Removes tabs from BuddyPress member profiles, such as Friends or Groups, while leaving the components switched on elsewhere.

- Type: PHP
- Runs: Run everywhere
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: buddypress, profile, navigation
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/buddypress-remove-profile-tabs/

## Code

```php
if ( ! function_exists( 'buddypress' ) ) {
    return;
}

// Profile tabs (or parent/child sub-tabs) to remove.
$wpide_bp_removed_tabs = array( 'friends', 'settings/profile' );

add_action( 'bp_setup_nav', function () use ( $wpide_bp_removed_tabs ) {
    foreach ( $wpide_bp_removed_tabs as $tab ) {
        if ( false !== strpos( $tab, '/' ) ) {
            list( $parent, $child ) = explode( '/', $tab, 2 );
            bp_core_remove_subnav_item( $parent, $child );
        } else {
            bp_core_remove_nav_item( $tab );
        }
    }
}, 1000 );
```

## Notes

Use tab slugs such as friends, groups, notifications, messages or settings. To remove a sub-tab add "parent/child", for example "settings/profile".

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "BuddyPress: Remove Profile Tabs You Don't Need" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
