WordPress at a glance
function is not described

user_pass_ok() WP 0.71

Deprecated from version 3.5.0. It is no longer supported and can be removed in future releases. Use wp_authenticate() instead.

Check that the user login name and password is correct.

No Hooks.


true|false. False if does not authenticate, true if username and password authenticates.


user_pass_ok( $user_login, $user_pass );
$user_login(string) (required)
User name.
$user_pass(string) (required)
User password.


  • See: wp_authenticate()


Since 0.71 Introduced.
Deprecated Since 3.5.0 Use wp_authenticate()

Code of user_pass_ok() WP 5.7

function user_pass_ok($user_login, $user_pass) {
	_deprecated_function( __FUNCTION__, '3.5.0', 'wp_authenticate()' );
	$user = wp_authenticate( $user_login, $user_pass );
	if ( is_wp_error( $user ) )
		return false;

	return true;