How to Hide BuddyPress Admin Menus

function plt_hide_buddypress_menus() {
	//Hide "Activity".
	remove_menu_page('bp-activity');
	//Hide "Appearance → Emails".
	remove_submenu_page('themes.php', 'bp-emails-customizer-redirect');
	//Hide "Tools → BuddyPress".
	remove_submenu_page('tools.php', 'bp-tools');
	//Hide "Settings → BuddyPress".
	remove_submenu_page('options-general.php', 'bp-components');

	//Hide "Emails".
	remove_menu_page('edit.php?post_type=bp-email');
	//Hide "Emails → All Emails".
	remove_submenu_page('edit.php?post_type=bp-email', 'edit.php?post_type=bp-email');
	//Hide "Emails → Add a New Email".
	remove_submenu_page('edit.php?post_type=bp-email', 'post-new.php?post_type=bp-email');
	//Hide "Emails → Customize".
	remove_submenu_page('edit.php?post_type=bp-email', 'bp-emails-customizer-redirect');

	//Hide "Users → Manage Signups".
	remove_submenu_page('users.php', 'bp-signups');
	//Hide "Users → Profile Fields".
	remove_submenu_page('users.php', 'bp-profile-setup');
	//Hide "Users → Member Types".
	remove_submenu_page('users.php', 'edit-tags.php?taxonomy=bp_member_type');
}

add_action('admin_menu', 'plt_hide_buddypress_menus', 1000);

Where do I put this code?