Reset WordPress Administrator PasswordThere are many different ways to do this. Today we will focus on how to useFTP (File Transfer Protocol)nextManually reset the administrator password. There will be details on how to passFTP Reset WordPress Administrator PasswordThe easy way to do this.
![图片[1]-使用FTP重置WordPress管理员密码的简便方法-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024070106390771.png)
preliminary
- FTP client software: First, it is necessary to install aFTP client softwareFor exampleFileZilla,Cyberducketc.
- FTP account information: Make sure you haveWeb Hosting(used form a nominal expression)FTP account informationIncludesFTP server address, username and passwordThe
- access authority: Access requiredWordPress Installation DirectoryThe
Step 1: Connect to the FTP server
- Open the FTP client::activate (a plan)your chosenFTP client softwareThe
- Enter FTP account information: In the FTP client's connection screen, typeFTP server address, user namerespond in singingcryptographicThen click on "grout".
- Navigate to the WordPress installation directory: Connectionspost-successNavigate toWordPress installation directoryThe usual
public_html
maybewww
file (paper)The
![图片[2]-使用FTP重置WordPress管理员密码的简便方法-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024070106500678.jpg)
Step 2: Edit the functions.php file
- Find the Themes folder: In the WordPress installation directory, find the currently usedTheme Folder. The path is usually
wp-content/themes/your-theme/
The - Download the functions.php file: inTheme Folderhit the nail on the head
functions.php
Documentation.right clickClick on the file and select "downloading", which will beDownload to local computer for editingThe - Edit the functions.php file: Use a text editor (e.g. Notepad++, Sublime Text) to open the downloaded
functions.php
file, add the following code:
function reset_admin_password() {
$user_id = 1; // By default, the admin user ID is 1
$new_password = 'your_new_password'; // set new password
wp_set_password($new_password, $user_id);
}
add_action('init', 'reset_admin_password');
4.Save and upload files: the editedfunctions.php
The file is saved and then uploaded back to the theme folder via an FTP client, overwriting the original file.
![图片[3]-使用FTP重置WordPress管理员密码的简便方法-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024070106503377.jpg)
Step 3: Login to WordPress Backend
- Visit the WordPress login page: Open your browser and visit your WordPress login page, which is usually
http://yourdomain.com/wp-login.php
The - Login with new password: Enter the administrator username and the new password you just set, then click "log in".
Step 4: Remove modified code
- Download the functions.php file: After successful loginone more timeDownload the theme folder via FTP client
functions.php
Documentation. - Remove the code you just added: Open with a text editor
functions.php
file, removing the previously added code:
function reset_admin_password() {
$user_id = 1;
$new_password = 'your_new_password';
wp_set_password($new_password, $user_id);
}
add_action('init', 'reset_admin_password');
3.Save and upload files: Save the file and then upload it back to the theme folder via an FTP client.Overwrite the original fileThe
![图片[4]-使用FTP重置WordPress管理员密码的简便方法-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/07/2024070106510681.jpg)
caveat
- safety: In the editorial
functions.php
file, make sure that theAdd onlyrespond in singingDelete the necessary codeto avoid disrupting the functionality of the site. - backup file: Before editing any file, it is recommended that you back up the original file to prevent operational errors from causing problems.
- Remove Code: After resetting your password, be sure to remove the added code in a timely manner to avoid security risks.
reach a verdict
Resetting WordPress administrator password via FTP is a reliable and effective method, especially when it is not possible to reset the password through other means. Follow the steps provided in this article to easily connect to the server via FTP, edit the theme files, and successfully reset the administrator password. Ensure that you remain cautious during the procedure and promptly remove the added code after completing the password reset to ensure the security of your website.
Alternative ways to reset the WordPress administrator password (see our "WordPress Reset Password: A Complete Detailed Guide") If you have any questions or suggestions, feel free to leave them in the comments section to discuss.
Link to this article:https://www.361sale.com/en/12182The article is copyrighted and must be reproduced with attribution.
No comments