Help! I’ve lost my WordPress admin password and I need to urgently reset / recover the administrator password


It’s a royal pain to loose your WordPress password, but do not fret as there are at least two ways to recover it. This article will provide two methods, one if you have PhpMyAdmin or database access, and two if you can upload files to the server.

Method 1 – How to Recover your WordPress Password If you have PhpMyAdmin Access

  1. Navigate to wp_users
  2. Edit user # 1 or any admin user
  3. Put in a new user_pass
  4. Make sure in function you select md5
  5. Click go.

Congratulations! Your password has been reset.

Method 1 – Upload file to server

Use S/FTP or SSH to get into the server, and then put the following PHP script into wp-content/mu-plugins/

 * Upload to wp-content/mu-plugins/recover_my_password.php
$login = 'foobar'; # New username
$password = 'barbaz'; # Password for the new user
$email = '[email protected]'; # Email address of the new user
$ip = ''; # Insert your IP,

if ($_SERVER['REMOTE_ADDR'] === $ip) {
    require_once(ABSPATH . WPINC . '/pluggable.php');
    require_once(ABSPATH . 'wp-admin/includes/' . 'user.php');

    $userdata = array(
        'user_login' => $login,
        'user_pass' => $password,
        'user_email' => $email,
        'role' => 'administrator',
    $user_id = wp_insert_user($userdata);
    die('delete me!');


Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top