Last active
September 18, 2016 23:19
-
-
Save Hammster/08f55d2319ae5cf53da7 to your computer and use it in GitHub Desktop.
Update user pasword in Wordpress if you've locked yourself out and can't acces your database
This file contains hidden or 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
function backdoor_admin() { | |
$user = get_user_by('login','admin'); | |
if( $user ) { | |
wp_set_password( 'NewPassWord128', $user->ID ) | |
} | |
} | |
add_action('init','backdoor_admin'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place this action to your current themes functions.php