Time needed: 5 minutes.
Change WordPress password via functions.php
- Login to your website via FTP
Login to your website via FTP and go to your theme’s functions.php file and download it. for example: /www/username/public_html/wp-content/themes/twentyfourteen/functions.php
- Edit functions.php
2. On line 2, right after the first <?php line add this:
In this example, we’re setting the password to password, and we’re updating it for the user user.
Alternatively you could use this code for the admin user 1:
wp_set_password( 'password', 1 );
- Upload the modified functions.php
Upload the modified functions.php file to your /themes folder on the server.
Login to your WordPress dashboard using the new password.
- Remove the line from functions.php
Remove the wp_set_password line from the functions.php file, and re-upload it.
If this did not work for you, you can try renaming /wp-content/plugins
This will deactivate all plugins, until you rename the folder again to /plugins. Sometimes there are plugin conflicts.
You can also change your WordPress password via phpMyAdmin.