Change the heading User Accounts in user Registration Page I am trying to change the heading in User Registration Page from User Account to Registration. 

I tried pre-processing, but in the page variable title is empty and I can only see rendered html.

I also tried using the following code in the settings.php file, but it doesn't seem to work.

$conf['locale_custom_strings_en'][''] = array(
  'USER ACCOUNT' =&gt; 'Registration',
  'Add new comment' =&gt; 'post new comment',
);
"User account" is the title that an anonymous user see for the "Create new account," "Log in," and "Request new password" pages. Replacing "User account" with "Registration" using $conf['locale_custom_strings_en'] would cause the string to be replaced in every place where "User account" is used, which is not correct.





The solution is to replace the title callback used for user with another title callback. Create a custom module, or add the following code to the custom module you are already using.

function mymodule_menu_alter(&amp;$items) {
  if (isset($items['user'])) {
    $items['user']['title callback'] = 'mymodule_user_title';
  }
}

function mymodule_user_title() {
  if (!user_is_logged_in()) {
    switch (current_path()) {
      case 'user':
      case 'user/login':
        return t('Log in');
      case 'user/register':
        return t('Create new account');
      case 'user/password':
        return t('Request new password');
      default:
        return t('User account');
    }
  }
  else {
    return t('My account');
  }
}


The code I used for mymodule_user_title() is exactly the same code used by Drupal 8 in its user_menu_title().

Other solutions, such as using the String Overrides module don't work too, as they replace the string independently from the context, which is important in this case. Users who are in the page for requesting a new password should not read "Register" as title because they are not registering.