Make the BP Non Editable Profile Fields Truly Non Editable • WordPress & BuddyPress Support Forums | BuddyDev

function bpfr_hide_profile_edit( $retval ) {

  // remove field from edit tab
   if ( bp_is_user_profile_edit() ) {
     $retval['exclude_fields'] = '2'; // field IDs separated by comma
   }

  // allow field on register page
  if ( bp_is_register_page() ) {
    $retval['include_fields'] = '2'; // field IDs separated by comma
  }

  // hide the field on profile view tab
  if ( $data = bp_get_profile_field_data( ‘field=2’ ) ) :  /// Joel MMCC: Does this also need to be changed, and if so, how for multiple fields?
    $retval['exclude_fields'] = '2'; // field IDs separated by comma
  endif;

return $retval;
}

Source: Make the BP Non Editable Profile Fields Truly Non Editable • WordPress & BuddyPress Support Forums | BuddyDev