how to rename password label on user edit page in Drupal? I would like to change labels only on user edit page. String overrides module would not work because it would rename all labels (user register and user edit). I tried the following:

function theme_preprocess_page(&amp;$vars, $hook) {
  if ($vars['template_files'][2] == 'page-user-edit') {
    $vars['content'] = str_replace('Password', 'New Password', $vars['content']);
    $vars['content'] = str_replace('Confirm password', 'Confirm new password', $vars['content']);
  }
}
If you're willing to do it in a module (you mentioned String Overrides module) you can easily do it with a simple hook_form_alter() in a small custom module.

function mymodule_form_user_edit_form_alter($form, &amp;$form_state) {
  $form['desired_element']['#label'] = t('My label');
  return $form;
}


This method uses hook_form_FORM_ID_alter(). This way you'll be able to set individual labels as you see fit, though.