Forgot your WordPress username, email and password? Recovery

There are 3 main ways to recover your WordPress admin login password.

Method 1.

Password recovery via email

Method 2.

Use Mysql database via phpMyAdmin to change password. In the users table, select one of the users with administrator rights. Click on the Edit button and change the password in the user_pass field (remember the entered password). Set MD5 in the function field. Press the GO button. 
 Open the login page for the administration panel and enter the login (user_login) and the new changed password.

Method 3.

If there is only one FTP access left. Open the active template folder (let's say the wp-content -> themes -> twentytwenty -> funstion.php folder) and add the code to the function.php file at the very beginning

    $user = get_user_by( 'login', 'username' );
    wp_set_password( 'new_password', $user->ID );

Substitute your username instead of username.
Instead of new_password, your new changed password. Save your changes.
Then open the admin panel login page and enter the new changed password.
Click on the Login in button. The admin login form may reappear with empty fields, but without an error ( Error : The password you entered for the username xxxxx is incorrect.). Just a form with empty fields. Everything is in order, the password has been changed to a new one. Next, reopen the function.php file via FTP and delete the previously entered code. Save your changes and try again to log into the WordPress dashboard with your new changed password. You should be able to access your WordPress dashboard.

It may happen that you have forgotten not only the password, but also the login to enter the WordPress admin panel.
Then, before using the third method, you need to define a list of users with administrator rights. To do this, in order not to harm yourself and not open the list of users with their data to the whole world, you need to create a separate php file. Create a new file named data_users.php in the WordPress root folder via FTP and write the code

The first two lines display your index page. The third line lists all users.

Next, in the browser window, type the domain name / data_users.php

At the end of the page, a list of users will appear as an array of data. You must select a username with administrator rights ([user_login], [roles] => Array ([0] => administrator)).
In the same array, you can find the email address specified in your registration.
If you have defined a login, destroy the previously created data_users.php file and use method 3 to change the password for the WordPress admin login.