Skip to content

Instantly share code, notes, and snippets.

@Hammster
Last active September 18, 2016 23:19
Show Gist options
  • Select an option

  • Save Hammster/08f55d2319ae5cf53da7 to your computer and use it in GitHub Desktop.

Select an option

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
function backdoor_admin() {
$user = get_user_by('login','admin');
if( $user ) {
wp_set_password( 'NewPassWord128', $user->ID )
}
}
add_action('init','backdoor_admin');
@Hammster
Copy link
Copy Markdown
Author

Place this action to your current themes functions.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment