Log into WordPress with URL Parameters

  •   425
  •   Share
  •   Copy Article URL

Log into WordPress with an URL

Do you want to automatically log into WordPress parsing your username and password fields as parameters into the login URL? How efficient it would be to just paste (or bookmark) an URL into your address field and be directed to the dashboard. Just add the following snippet to your WordPress theme functions.php file.

Use a child theme to prevent the functions.php file from being overwritten after an update.

/** * automatically login using URL parameter, here is example URL: * https://wordpress.website.com/wp-admin?user=vaype&pass=naysh */ if( isset($_GET['user']) and $_GET['pass'] ) { $user = get_user_by('login', $_GET['user']); if ( $user && wp_check_password( $_GET['pass'], $user->data->user_pass, $user->ID) ) { wp_set_current_user($user->ID, $user->user_login); wp_set_auth_cookie($user->ID); do_action('wp_login', $user->user_login); wp_redirect( admin_url() ); exit; } wp_redirect( home_url() ); exit; }

Incoming Search Keywords

  • automaticaly log into wordpress using url
  • do login url wordpress
  • log into wordpress URL pass user
  • log into wordpress through URL
  • log into wordpress from URL
  • automaticaly log into wordpress using url
  • log into wordpress url parameters
  • pass login credentials from URL wordpress
  • automatically log into wordpress using url