Recover passwords in WordPress. Part I

Hello everyone, today we are going to address a more common problem than it might seem. Either because the site has been hacked, or because we do not remember, we are going to teach you how to recover passwords in WordPress

Options to recover passwords in WordPress

The first step would be to try to recover the password from WordPress itself. To create a user in WordPress it is necessary to indicate a valid email . This email will be used to reset the password of the user that we do not have access to.

The first thing we must do, is being in the WordPress login window, click on “ have you forgotten your password?

Recover passwords in WordPress gpsos

In the next window, it will ask us to enter the username or email of the user that we want to recover.

After entering the email, we will receive an email with a link to reset the password and it will generate a default one.

In case of not being able to access our email, we will have two options, do it through the database, or creating a new WordPress user from FTP. Although there are more ways to recover WordPress.

Create WordPress user from FTP

If we have access by FTP, we can try to create a new user with administrator permissions, which will later allow us to reset the password of the other user that we want to recover. To do this, we must modify the functions.php file after copying the theme and create the user as follows:

function new-user-account(){
   $user = 'Usuario_nuevo';
   $pass = 'Password_nuevo_Usuario';
   $email = 'usuario@dominio.es';
if (!username_exists( $user ) && !email_exists( $email ) ){
   $user_id = wp_create_user($user, $pass, $email);
   $user = new WP_User( $user_id );
   $user->set_role( 'administrator' );
}
add_action('init','new-user-account');

You may also be able to contact the hosting provider if they can help you. We hope that with this entry you have been able to regain access to your WordPress. Soon we will publish more posts about WordPress. If you liked it, do not hesitate to subscribe to our newsletter monthly. You will receive only one email per month with all our entries from the last month. We talk about Linux, databases, Oracle, SQL Server

See you in next innings.

Still do not know Query Performance ? Find out how it can help you in your Oracle environment. More information on their page LinkedIn .

Follow GPS on LinkedIn

Source: https://ayudawp.com/recuperar-crear-administrador/