Skip to content

Instantly share code, notes, and snippets.

@mathewjosephh
Created August 22, 2016 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathewjosephh/b2b21c99d53ae5c77adc752096fd0946 to your computer and use it in GitHub Desktop.
Save mathewjosephh/b2b21c99d53ae5c77adc752096fd0946 to your computer and use it in GitHub Desktop.
Reset Password - Wordpress
<?php
$user_id = 1; # Insert your user ID or simply 1 for the first user that was created
$user_pass = 'secret'; # Insert a new password
$ip = '127.0.0.1'; # Insert your IP
if ($_SERVER['REMOTE_ADDR'] === $ip) {
require_once(ABSPATH . WPINC . '/registration.php');
require_once(ABSPATH . WPINC . '/pluggable.php');
$user = wp_update_user(array(
'ID' => $user_id,
'user_pass' => $user_pass,
)) ;
var_dump(get_userdata($user));
die('disable me!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment