Knowledgebase

How to Reset WordPress Password Via FTP?

Lost your WordPress Password?

Here is a simple solution for you!

You can easily reset your WordPress Admin Password with the help of FTP. 

The best part of following this solution is that even if you don’t have access to the WordPress MySQL database, You can change your password with the help of FTP. 

This article will discuss the steps for quickly resetting the password through FTP.


Also Read: How to Use FileZilla with WordPress?


The Process to Reset WordPress Password With FTP

➢ Launch Filezilla & log in to your account by inserting the host, username & password.

FileZilla options

➢ After Adding Details, Click on ‘Quickconnect’

Select Quick Connection option

➢ Once connected, you will see the ‘Remote Site’ on the right-hand side of the FileZilla interface containing your website file directory.

Connect with server

➢ You have to Navigate to the root directory of your WordPress, which is typically kept in the ‘public_html’ folder (Note: It may differ depending on your hosting setup). Once you find the folder, Double click on it to open. 

Select public html folder

➢ Within the directory, You have to navigate to the folder name ‘wp-content’ & double-click on it to open.

Select wp-content

➢ After opening, you have to double-click on the folder named ‘themes.’

Select themes folder

➢ Here, A list of theme folders will appear. From those, Open the folder of your currently active theme. 

Select Folder

➢ In that, you will find the ‘functions.php’ file. You have to download the file by right-clicking on it.

Download File

➢ There is a line of code given below that you need to add after the first ‘<?php’ line.

wp_set_password( ‘new_password’, 1 )

Just remember that number ‘1’ at the end of the code line is the user ID of the WordPress user that you are looking to reset the password. If you have a default administrator account you created during WordPress installation, the user ID is always 1 for that.

You need to Replace ‘new_password’ with the new password you want to keep.

Edit File

➢ Once you make the changes, save it and upload the modified functions.php file.

➢ Once done, Go to the WordPress login page & enter the updated credentials.

Nothing happened?

Is it showing an empty form without notice about an incorrect password?

Don’t worry; that’s completely normal! 

Don’t try to log in again.

  •  You have to download the same file and remove the added line of code we gave you above. 
  •  After removing the line of code, upload it back to its location.
  •  Now try it. You should be able to log in to your WordPress by using a new password.

Also Read: How To Get FTP Password From FileZilla


Conclusion

It’s proved that Resetting your WordPress password through FTP can be a lifesaver when you are locked out of your WordPress Admin area. With the help of the steps mentioned in this article, you can regain access to your WordPress website and continue managing it with a new password.