Changing the label of Change Password Form How to change the form label from Password to New Password and Confirm password to New Confirm password on THEME_form_user_form_alter(without changing any twig files)? I had tried kint($form['account']['pass']) to see any possible way, no clue...

Current Change Password Form

Current password

|||||||||||||||||

Password (to New Password)

|||||||||||||||||

Confirm password (to New Confirm password)

|||||||||||||||||

function THEME_form_user_form_alter(&amp;$form, $form_state) {
  kint($form['account']);
}


There are no #title element on pass field.
You have to create a new module and use hook_element_info_alter
to alter title input like this:

function my_module_element_info_alter(array &amp;$types) {
  if (isset($types['password_confirm'])) {
    $types['password_confirm']['#process'][] = '_mymodule_change_title';
  }
}


and process function

function _mymodule_change_title(&amp;$element) {
  $element['pass1']['#title'] = t('New title 1');
  $element['pass2']['#title'] = t('New title 2');
  return $element;
}


and as a result