2.13.1.7. Change admin password in WordPress

Warning!

Find out the current admin password technically impossible, since it is not stored on the site in an open form — only its hash is stored. It is only possible to replace the password with a new one.

There are several ways to change your WordPress admin password:

  1. In the site config file takealook the name of the database to which it is connected.
  2. Openup database in phpMyAdmin.
  3. Execute the following SQL query, instead of new_password New Password:
    UPDATE wp_users SET user_pass = MD5('new_password') WHERE id = 1;

    If the names of the tables in the database do not start with the standard wp_, and with a different prefix, make the appropriate change to the SQL query.

  4. Check the entrance to Adminpanel.

Warning!

This method involves changing the user's password, having administrator access data to the site's admin panel.
  1. Sign in Adminpanel site.
  2. Go to section "Members → All users":
  3. Hover over the desired user and click "Change":
  4. At the very bottom of the page in the section "Account management" click "Create a password":
  5. In the field that appears, a new password will be displayed, which you can leave or change yourself to a more suitable one, after which you need to click "Update profile" to accept changes:
  1. Go to login page into the admin panel and click "Forgot password?":
  2. Specify the mailbox of the user to which the password was lost and click "Get a new password":
  3. An email will be sent to the mailbox with a password reset confirmation link, which must be followed.
  4. On the page that opens, copy and / or edit the generated password and click "Set password":
  5. Sign in Adminpanel with a new password.
  1. Using filemanager or any FTPclient, enter the site directory and go to the directory wp-contentin which create a directory mu-plugins. Warning! The directory should have exactly this name, it should not be confused with the directory plugins.
  2. In the created directory mu-plugins create a file recovery.php and put the following code in it:
    <?php
    add_action( 'init', 'my_password_recovery' );
    function my_password_recovery() {
        $user = get_user_by( 'login', 'admin' );
        wp_set_password( 'password', $user->ID );
    }
    unlink(__FILE__);

    Instead admin specify the username that is used to log in, and instead of password enter a new password.

  3. Go to the authorization page and log in with a new password. Please note that the script will be automatically deleted after triggering, so no additional action is required.
Content