HostOnNet Blog

How to Reset WordPress Admin Password Through FTP

wordpress

Login to your site via FTP and download your active theme’s functions.php file.

Edit the file and add this code to it, right at the beginning, after the first <?php:

wp_set_password( 'password', 1 );

Replace the ‘password’ with you new password. 1 in the function indicates the user id in the wp_users table which is for admin user

Save the file upload it back to your web site

Then after you will be able to login to the site using the new password.

After you then are able to login, make sure to go back and remove that code. It will reset your password on every page load until you do.


About Annie

I've been working in Technical Section for over 10 years in a wide range of tech jobs from Tech Support to Software Testing. I started writing blog for my future reference and useful for all.
Posted in Wordpress