Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @muvuth,

    I am suggesting you to create a new Admin user with a piece of code that helps you log in if you forget old user details.

    You can change passwords directly from the database from the users table and it must be encrypted.

    function wpb_admin_account(){
    $user = ‘Username’;
    $pass = ‘Password’;
    $email = ’[email protected]’;
    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’,’wpb_admin_account’);

    Make sure you can’t use the same email address, so if you have used email then for temporarily, you have to change that email address from the database.

    Thread Starter muvuth

    (@muvuth)

    Thank you @parin96 for your suggestion.

    Can I do that while locked out? If not, I need to solve the login issue first, and then I’ll see how to follow your suggestion.

    Thank you

    Yes Muvuth, you can create user from that code without login.
    You need to add that code in fuction.php file of your active theme.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Locked out’ is closed to new replies.