Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp authenticate


Checks a user's login information and logs them in if it checks out.

  • This is a plugabble function, which means that a plug-in can override this function.
  • Not to be confused with the wp_authenticate action hook.


(string) (required) User's username
Default: None
(string) (required) User's password
Default: None

Return Values

Returns WP_User object if login successful, otherwise WP_Error object.

Errors can be verified with is_wp_error()

Change Log

Since: 2.5.0

Source File

wp_authenticate() is located in wp-includes/pluggable.php