2.13.1.7. Change admin password in WordPress
Attention!
Current administrator password impossible to know, since it is not stored on the site in cleartext, only its hash is stored. The password can only be changed to a new one.- Click "CMS install" site menu:
- Click "Password reset":
- Select a user, enter a new password, and click "Change password":
- In the site config file takealook the name of the database to which it is connected.
- Openup database in phpMyAdmin.
- 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. - Check the entrance to Adminpanel.
Attention!
This method involves changing the user's password, having administrator access data to the site's admin panel.- Sign in Adminpanel site.
- Go to login page into the admin panel and click "Forgot password?":
- An email will be sent to the mailbox with a password reset confirmation link, which must be followed.
- Sign in Adminpanel with a new password.
- Using filemanager or any FTPclient, enter the site directory and go to the directory
wp-content
in which create a directorymu-plugins
. Attention! The directory should have exactly this name, it should not be confused with the directoryplugins
. - In the created directory
mu-plugins
create a filerecovery.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 ofpassword
enter a new password. - 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.