Easy way to reset WordPress administrator password using FTP

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修复服务,全球范围,快速响应

preliminary

  1. FTP client software: First, it is necessary to install aFTP client softwareFor exampleFileZilla,Cyberducketc.
  2. FTP account information: Make sure you haveWeb Hosting(used form a nominal expression)FTP account informationIncludesFTP server address, username and passwordThe
  3. access authority: Access requiredWordPress Installation DirectoryThe

Step 1: Connect to the FTP server

  1. Open the FTP client::activate (a plan)your chosenFTP client softwareThe
  2. Enter FTP account information: In the FTP client's connection screen, typeFTP server address, user namerespond in singingcryptographicThen click on "grout".
  3. Navigate to the WordPress installation directory: Connectionspost-successNavigate toWordPress installation directoryThe usualpublic_htmlmaybewwwfile (paper)The
图片[2]-使用FTP重置WordPress管理员密码的简便方法-光子波动网 | 专业WordPress修复服务,全球范围,快速响应

Step 2: Edit the functions.php file

  1. Find the Themes folder: In the WordPress installation directory, find the currently usedTheme Folder. The path is usuallywp-content/themes/your-theme/The
  2. Download the functions.php file: inTheme Folderhit the nail on the headfunctions.phpDocumentation.right clickClick on the file and select "downloading", which will beDownload to local computer for editingThe
  3. Edit the functions.php file: Use a text editor (e.g. Notepad++, Sublime Text) to open the downloadedfunctions.phpfile, 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.phpThe file is saved and then uploaded back to the theme folder via an FTP client, overwriting the original file.

    图片[3]-使用FTP重置WordPress管理员密码的简便方法-光子波动网 | 专业WordPress修复服务,全球范围,快速响应

    Step 3: Login to WordPress Backend

    1. Visit the WordPress login page: Open your browser and visit your WordPress login page, which is usuallyhttp://yourdomain.com/wp-login.phpThe
    2. Login with new password: Enter the administrator username and the new password you just set, then click "log in".

    Step 4: Remove modified code

    1. Download the functions.php file: After successful loginone more timeDownload the theme folder via FTP clientfunctions.phpDocumentation.
    2. Remove the code you just added: Open with a text editorfunctions.phpfile, 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修复服务,全球范围,快速响应

      caveat

      1. safety: In the editorialfunctions.phpfile, make sure that theAdd onlyrespond in singingDelete the necessary codeto avoid disrupting the functionality of the site.
      2. backup file: Before editing any file, it is recommended that you back up the original file to prevent operational errors from causing problems.
      3. 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.


      Contact Us
      Can't read the article? Contact us for free answers! Free help for personal, small business sites!
      Tel: 020-2206-9892
      QQ咨询:1025174874
      (iii) E-mail: info@361sale.com
      Working hours: Monday to Friday, 9:30-18:30, holidays off
      © Reprint statement
      This article was written by Harry
      THE END
      If you like it, support it.
      kudos0 share (joys, benefits, privileges etc) with others
      commentaries sofa-buying

      Please log in to post a comment

        No comments