![图片[1]-如何重置 WordPress 管理员密码-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024071007545350.png)
WordPress is the world's most popular content management system, with over 43% websites built using it worldwide. As powerful as WordPress is, users occasionally forget their login credentials for managing their websites. In this article, we'll cover a few quick ways to recover your WordPress administrator password.
Use the "Forgot Password" option
The easiest way to reset your password is through the "Forgot your password?" option on the WordPress login page. option on the WordPress login page. The procedure is as follows:
![图片[2]-如何重置 WordPress 管理员密码-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024071007591449.png)
- Go to the WordPress login page, the URL is usually
https://www.example.com/wp-admin
The name "example.com" is your domain name. - Click below the Login Name and Password fields on the "Forgot your password?"Link.
- Enter the username or e-mail address associated with your administrator account.
- Click "Get new password"Button.
- Check your email inbox and click on the link to reset your password.
- Enter a new strong password and click "Save new password".
Using phpMyAdmin
If it is not possible to pass the "forgotten password?" option to reset the password, or if you cannot access the administrator's email address, you can reset the password using phpMyAdmin. Below are the exact steps:
- Log in to phpMyAdmin.
- Select your WordPress database.
- find
wp_users
table and click on "compiler"Button.
![图片[3]-如何重置 WordPress 管理员密码-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024071008003587.png)
- exist
user_login
column to find your username. - exist
user_pass
column, select MD5 as the function. - Enter your new password in the Value field.
- Click "fulfillment" button to confirm the operation.
![图片[4]-如何重置 WordPress 管理员密码-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024071008015146.png)
Edit the functions.php file
It is also possible to edit the theme by editing the functions.php
file to reset the password:
- Log in to the server using an FTP client (such as WinSCP).
- Navigate to
wp-content/themes/your-theme
Catalog. - locate
functions.php
Documentation. - Add the code at the beginning of the file:
wp_set_password('new_password', 1);
whichnew_password
It's your new password.
![图片[5]-如何重置 WordPress 管理员密码-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024071008035064.png)
- Save changes to the file.
- Delete changes to the file after a successful login.
Using WP-CLI
WP-CLI is a command line tool that allows you to manage your WordPress installation from the command line:
- Establish an SSH connection with the server.
- Navigate to the WordPress installation directory.
- importation
$ wp user list
Find target users. - utilization
$ wp user update user_id --user_pass=new_password
command to update the password.
[admin@admin public_html]$ wp user update admin -user_pass=yournewpassword
Success: Updated user 1.
[admin@admin public_html]$
Using the MySQL Command Line
![图片[6]-如何重置 WordPress 管理员密码-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024071008055186.png)
Advanced users can reset the password from the MySQL command line:
- Get the MD5 hash of the password.
- Log in to the server using SSH and log in to MySQL.
- Select your WordPress database.
- Find the table containing the list of users (usually
wp_users
). - utilization
UPDATE wp_users SET user_pass='MD5_hash' WHERE user_login='your_username';
command to update the password.
Using the Emergency Password Reset Script
When all else fails, an emergency password reset script can be used:
- Copy the script from the Emergency Password Script page and save it as
emergency.php
file, upload it to the WordPress installation root directory. - Open in your browser
http://www.example.com/emergency.php
The - Enter the administrator name and new password.
- Save changes and delete
emergency.php
Documentation.
reach a verdict
Resetting your WordPress administrator password isn't difficult, as long as you use the right method. Either through the "forgotten password?"Options,phpMyAdminEditorial functions.php
Documentation,WP-CLI,MySQL command line, or an emergency password reset script to effectively restore access to your website. Before making any changes, be sure to back up your database in case something goes wrong during the operation.
![图片[7]-如何重置 WordPress 管理员密码-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/06/2024061301281171.png)
Link to this article:https://www.361sale.com/en/13185The article is copyrighted and must be reproduced with attribution.
No comments