If you use Two Factor Authentication (2FA) for Admins on your WordPress site (which you should) you may not want to show the big setup UI to customers or forum users.

Here is how you can get rid of that:

// Hide 2fa on bbpress pages
function bbpress_hide_2fa(){
	if (function_exists('is_bbpress') && is_bbpress()){
		remove_action( 'show_user_profile', ['Two_Factor_Core', 'user_two_factor_options'], 10);
		remove_action( 'edit_user_profile', ['Two_Factor_Core', 'user_two_factor_options'], 10);
	}
}
add_action( 'show_user_profile', 'bbpress_hide_2fa', 5);
add_action( 'edit_user_profile', 'bbpress_hide_2fa', 5);

Add that to your functions.php file and it should be nicely removed!

I have been testing semi-automatic deployment of this site (since removing it from Github Pages) and I need to have a commit to push… Don’t be surprised if there are a bunch of tiny posts like this. I guess its good encouragement.