Skip to content

Instantly share code, notes, and snippets.

@PabloWestphalen
Created January 10, 2019 00:29
Show Gist options
  • Save PabloWestphalen/203c0e79b13b5fbe00fbacfd56e5dc8b to your computer and use it in GitHub Desktop.
Save PabloWestphalen/203c0e79b13b5fbe00fbacfd56e5dc8b to your computer and use it in GitHub Desktop.
<?php
/*
* Author: Pablo Westphalen
*
* http://www.github.com/PabloWestphalen
*
*
* Usage: place this file in wp root dir
* then access your WP_URL/logmein.php
*/
require_once('wp-config.php');
$admin = get_users(array("role" => "administrator"));
$admin = $admin[0];
wp_clear_auth_cookie();
wp_set_current_user ( $admin->ID );
wp_set_auth_cookie ( $admin->ID );
wp_redirect(get_dashboard_url());
exit;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment