email_exists

Checks whether the given email exists.

Description

(int|false) email_exists( (string) $email ); 

Returns (int|false)

The user's ID on success, and false on failure.

Parameters (1)

0. $email (string)
The email.

Usage

  1. if ( !function_exists( 'email_exists' ) ) { 
  2. require_once ABSPATH . WPINC . '/user.php'; 
  3.  
  4. // The email. 
  5. $email = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = email_exists($email); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/user.php  
  1. function email_exists( $email ) { 
  2. if ( $user = get_user_by( 'email', $email) ) { 
  3. return $user->ID; 
  4. return false;