2.14.1.7. Change administrator password in WordPress

Attention!

The current administrator password cannot be retrieved because it is not stored on the site in plain text — only its hash is stored. The password can only be changed to a new one.
  1. Open the "HostingMy sites" section.
  2. Click "CMS install" in site menu:
  3. Click "Reset password":
  4. Select the user, specify the new password, and click "Change password":
  1. In the site configuration file, check the name of the database to which it is connected.
  2. Open database in phpMyAdmin.
  3. Execute the following SQL query, specifying the new password in place of new_password:
    UPDATE wp_users SET user_pass = MD5('new_password') WHERE id = 1;

    If table names in database do not start with standard wp_ but with another prefix, make corresponding change in SQL query.

  4. Check the login to admin panel.

Attention!

This method implies changing the user password using administrator access credentials for site admin panel.
  1. Sign in to admin panel of site.
  2. Go to "Users → All users":
  3. Hover over the required user and click "Edit":
  4. At the bottom of the page in the "Account management" section, click "Create password":
  5. In the displayed field, a new password appears, which you can keep or change to a more suitable one, after which you must click "Update profile" to apply changes:
  1. Go to login page of admin panel and click "Forgot your password?":
  2. Specify the user mailbox for which the password was lost, and click "Get new password":
  3. A message with a password reset confirmation link will be sent to your email address. Follow link to confirm the password reset.
  4. On the page that opens, copy and/or edit the generated password and click "Set password":
  5. Sign in to admin panel with new password.
  1. Using file manager or any FTP client, sign in to site directory and go to wp-content directory, where you must create mu-plugins directory. Attention! Directory must have exactly this name; do not confuse it with plugins directory.
  2. In created mu-plugins directory, create recovery.php file and place 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 of admin specify the login used for sign-in, and instead of password specify the new password.

  3. Go to the login page and sign in with new password. Note that script is automatically deleted after it runs, so no additional actions are required.
Content

    (3)

    Comments

    yankor8
    Дякую! Супер!!!