Remove ‘The content of this field is kept private and will not be shown publicly.’ Form Help Text in Drupal 6

Using profile module, I have set up a number of fields for user information. Because they are for members’ profile only, I set them as private field in the backend, but when user is editing the form in the frontend, each field shows help text “The content of this field is kept private and will not be shown publicly.” underneath.

drupal-6-form-field-help-text

This looks especially ugly when you have lots of fields to show and my client requested to remove it completely.

There are a couple of ways to remove it, but for my purpose, it is as simply as remove the code generated this text.

Open file /modules/profile/profile.module and simply comment out line 340:


function _profile_form_explanation($field) {
  $output = $field->explanation;

  if ($field->type == 'list') {
    $output .= ' '. t('Put each item on a separate line or separate them by commas. No HTML allowed.');
  }

  if ($field->visibility == PROFILE_PRIVATE) {
    //$output .= ' '. t('The content of this field is kept private and will not be shown publicly.');
  }

  return $output;
}

You might also want to use String Overrides module for Durpal 6 if you don’t feel to modify the source code.