Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hamedmoody/cdae2976b3ad0f875459663141c2b23b to your computer and use it in GitHub Desktop.
Save hamedmoody/cdae2976b3ad0f875459663141c2b23b to your computer and use it in GitHub Desktop.
<?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