• Resolved Bikramjit

    (@bikram00)


    Hi, I’m using this function to completely redirect my wp-login to front-end login.

    //My Login page
    add_action('init','custom_login_page');
    
    function custom_login_page() {
     $new_login_page_url = home_url( '/login/' ); // new login page
     global $pagenow;
     if( $pagenow == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') {
        wp_redirect($new_login_page_url);
        exit;
     }
    }

    But the problem is that the email confirmation doesn’t work because of this code. Is there a way I can make the email-confirmation work even after disabling/redirecting my wp-login?

Viewing 1 replies (of 1 total)
  • Hello Bikram,

    By default user registration email confirmation link redirects to wp-login.php and since you are redirecting to your custom login. It fails. You can redirect the confirmation link to your login form too. Navigate to: User Registration->Settings->Emails->Email Confirmation and replace this line:

    Please click on this verification link {{home_url}}/wp-login.php?ur_token={{email_token}} to confirm registration.

    to:

    Please click on this verification link {{home_url}}/login?ur_token={{email_token}} to confirm registration.

    Also, rather than to hook on init preferred way is to hook into login_init to redirect to frontend login page. Follow this documentation: https://docs.wpeverest.com/docs/user-registration/how-to/how-to-hide-wordpress-default-login-page-and-use-user-registration-login-page/

    Regards,
    WPEverest Support

Viewing 1 replies (of 1 total)
  • The topic ‘Email-confirmation failing ?’ is closed to new replies.