authenticate user without password from email activation link

This question already has an answer here:

  • Can I programmatically login a user without a password?

    5 answers

Solutions Collecting From Web of "authenticate user without password from email activation link"

To login a user progrmaticly you can use:

    //Login the user
$creds = array();
$creds['user_login'] = $login;
$creds['user_password'] = $password;
if ( !empty( $remember ) ){ 
    $creds['remember'] = true;
}
$user = wp_signon( $creds, true );

but as you can see you will need to have the password present , so you can just add to your actovation url &pw=pasword and call it using $_GET[‘pw’].