WordPress auto login after registration not working
Short answer – Your original function (mostly) works. This is your function edited to do what it needs to do: function automatically_log_me_in( $user_id ) { wp_set_current_user( $user_id ); wp_set_auth_cookie( $user_id ); wp_redirect( home_url( ‘/some-ending-page/’ ) ); exit(); } add_action( ‘user_register’, ‘automatically_log_me_in’ ); Long answer – here is an explanation of why this is the answer. … Read more