Last active
March 27, 2019 21:39
-
-
Save soup-bowl/9fe48b278ff754f1b49118724f17adf2 to your computer and use it in GitHub Desktop.
Passwordless Login for WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once(__DIR__."/../wp-load.php"); | |
$usr = get_user_by('ID', 1); | |
wp_clear_auth_cookie(); | |
wp_set_current_user($usr->ID); | |
wp_set_auth_cookie($usr->ID); | |
wp_safe_redirect(user_admin_url()); | |
exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful for when a user reports an issue with a specific user account. I can put this on the server and quickly log in to the user's account.
There's plenty out there that are either more efficient or more secure, but as a fire and delete script it does the job. Simply stick on the server, change the ID to the user's account, browse to the script and then delete afterwards.