The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress Registration Email Validation

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #33163

    Hi there,

    I’ve created a custom registration page using Registration Plus Redux and I need to create a more specific email validation. Basically I need to only allow ‘’ email addresses to register. But I need people to be able to register with emails such as:

    [email protected]

    and also

    [email protected]

    Any help would be greatly appreciated. I have tried to use a plugin called ’email validation’ or something similar, but it hasn’t been updated in over a year and either doesn’t work or isn’t compatible with registration plus redux.

    Thanks in advance


    Hi jlau, I guess you are meaning “how to validate such an email address”.

    Basically you may have a regular expression to do this in PHP, and maybe following code will work for you:

    echo "Yeah, you have an email address!";
    echo "Oops, your email address is not valid or is not an email address!";

    Hi ddliu,

    Thanks a lot for the reply. I really appreciate it. I’m not super comfortable with php/wordpress. So where would I put this code in my theme to get it to affect my registration?

    If it helps my website is


    I don’t think it’s in the theme, you may change it here:
    file wp-login.php, find function “register_new_user”, find code:

    // Check the e-mail address
    if ( $user_email == '' ) {
    $errors->add( 'empty_email', __( 'ERROR: Please type your e-mail address.' ) );
    } elseif ( ! is_email( $user_email ) ) {
    $errors->add( 'invalid_email', __( 'ERROR: The email address isn’t correct.' ) );
    $user_email = '';
    } elseif ( email_exists( $user_email ) ) {
    $errors->add( 'email_exists', __( 'ERROR: This email is already registered, please choose another one.' ) );

    add following code at the end of the if…else… scope:

    elseif (!preg_match('#[@.]$#i', $user_email){
    $errors->add( 'invalid_email', __( 'ERROR: Only "" email address allowed.' ) );
    $user_email = '';

    Maybe there is a way to change it in the theme? I have no idea, don’t know that much.


    Thanks a lot! It worked well :)

    If anyone else wants to use this code. Theres a right bracket missing after $user_email.

    Does anyone know how to change this from the theme?


    Hi , its very easy to verify Email validation. For Email Validation you can simply go through this site


    One link might be useful if it’s relevant enough. But three in a row without anything else and I’d say you’re a spammer.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.