How to change Drupal's default login error text I have tried using this code - 

     */
    function customform_demo_form_alter(&amp;$form, &amp;$form_state, $form_id) {
     global $user;

      if ($form_id == 'user_login'); {
        if (!$user-&gt;uid) { 
            array_unshift($form['#validate'],'customform_demo_user_login_form_validate');
        }else{
        drupal_get_messages();
        }   
      }

}

function customform_demo_user_login_form_validate(&amp;$form, &amp;$form_state) {
  drupal_set_message('Your username or password was not recognized. &lt;a class="login_link" href="/user/password"&gt;Click here to reset your password.&lt;/a&gt;', 'status');
}


but can't get the message in the default format.
I'm pretty sure you shouldn't have a semi-colon after your if condition.

 if ($form_id == 'user_login'); {}


Does removing that have any effect?