База на знаења

Forgot password in WordPress? Recover a lost password. 3 solutions. Print

  • 0

Forgot password in WordPress? Recover a lost password. 3 solutions.

WordPress has a few ways to reset your password. Some of them are quicker than the others or may be more difficult. Everything depends on your skills and access that you have.

Resetting password in WordPress via FTP

  • Login to your FTP client and edit file functions.php in the theme that is active.
  • Add this line after first <?php

  • wp_set_password( 'password', 1 );

    'password' - your new password
    1 - ID of the user. You can check it using PHPMyAdmin. If you don't have a possibility to do that check ID = 1. If you have only one administrator, there is a large probability that you will have luck :-)
  • Go to https://yourwebsite/wp-admin and enter your username and password: password. You will not be signed into the backend, but the login form would just refresh.
  • IMPORTANT: do not try login to backend now. Now reverse your changes in functions.php - just delete this new line. Until you do that password will be reset on every login attempt. Your new password is password.
  • After the first login just changes your password to safer by editing your profile.

Resetting password in WordPress via WP CLI

WP CLI is a command line that you can use for managing Wordpress. Read more about WP CLI here.

  • Go to your Wordpress installation directory and enter:
  • $ wp user list

  • You will see all users and ID of them. Remember ID of the user that you want to change the password.
  • Update user using this line:

    wp user update 1 --user_pass=newpassword

    1 - ID of the user that you want to change the password
    new password - your new password

Recover password in WordPress by e-mail

This is the simplest way, and you don't need any knowledge of PHPMyAdmin or FTP. 
IMPORTANT: You need to know an email address for your user.

  • Go to https://yourwebsite/wp-admin
  • Now click on Lost your password?

1.WordpressLoginpage.png


Type your username or email address and then click on Get New Password

2.Username page.png

similar email message:

Password request.png
  • Click on this link at the end of the message.
  • You will be redirected to the page where you can use generated by WordPress password or use your password. Click Reset Password when you are done.

5.Enter password.png

Reset password in WordPress via PHPMyAdmin

This method is useful when we forget username either.

  • Go to PHPMyAdmin
  • Select the correct database on the left-hand side. You can find the database name in the wp-config.php file. There will be a line:

    define('DB_NAME', 'database_name'); 

    database_name
     - the name of your database
  • Now select table prefix_users, usually wp_users:

6.logged in wp users.png

  • You will see there is also username if you forgot it either :-) It's stored in field user_login.
  • Click on Browse:

7.Browse.png

Now click on Edit icon next to your user:

8.Edit.png

You will see fields like these:

9.Password  encrypted.png

  • Take a look at field user_pass. There is an MD5 encrypted password. You need to generate your new MD5 password. You can use this tool.
  • Type your new encrypted password into the user_pass field.
  • Click on Go when you are done.

10.Go.png
.

Дали Ви помогна овој одговор?
Back