Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: [Resolved] How to hide more than one profile field?

@simpleone

Participant

@commoneasy

I found another solution that was suggested by someone in a different thread I had opened. Instead of modifying the edit.php file, I simply put the following code inside my functions.php file in my child theme. (Or you could put it in bp-custom.php.)

Please be warned that this solution didn’t work when I tried it on my site running BP 1.9.1. (Even though my desired fields were successfully hidden by this solution, I still received a “required fields” error message after clicking the Save button.)

So, in order for this to work, you need to be running BP 2.0 +.

The below profile field ids 1, 32, and 48 correspond to the three fields I needed to hide from editing.

function simple_one_hide_some_profile_fields( $retval ) {	
	if(  bp_is_profile_edit() ) {		
		$retval['exclude_fields'] = '32,48,1';	//field ID's separated by comma
	}	
	
	return $retval;
}
add_filter( 'bp_after_has_profile_parse_args', 'simple_one_hide_some_profile_fields' );

Try inserting the following into your functions.php or bp-custom.php and see if it works. I modified my above code specifically to hide your profile field id 15.

function commoneasy_hide_some_profile_fields( $retval ) {	
	if(  bp_is_profile_edit() ) {		
		$retval['exclude_fields'] = '15';	//multiple field ID's should be separated by comma
	}	
	
	return $retval;
}
add_filter( 'bp_after_has_profile_parse_args', 'commoneasy_hide_some_profile_fields' );
Skip to toolbar