reset wordpress username and password via FTP

I have a website that is hosted by godaddy.My website made in WordPress and I want access my word press websites admin panel and I do not have username and password but I have access to FTP of my website.
Kindly tell me if there is any way I can reset or know previous username and password of my word press admin panel?
Many Thanks.
Mark

Related posts

Leave a Reply

4 comments

  1. You may also add following code in functions.php to create a new admin user

        function wpb_admin_account(){
    $user = 'Username';
    $pass = 'Password';
    $email = 'email@domain.com';
    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');
    

    I had implemented this solution when I was stuck in same issue.

  2. I’m not sure of a way you can reset your password or check your username via FTP. You need to access your database for that information. I would Login to your cpanel at godaddy and go into phpMyAdmin. Login in and find your WordPress database, and then look at the table called wp_users. This will give you a list of all the users and their information. The password will be encrypted, but you now be able to go to the WordPress login page and click forgot password and rest one of the users now that you know the right username or the email associated to that user.

  3. To reset your password using ftp

    1. download function.php file of your activated theme.

    2. put this function

    3. save and upload

    You can also use this function to create new user.

    $user_id = wp_create_user($username, $password); //it will return user id
    
    $user = new WP_User($user_id); //get the user
    
    $user>set_role('administrator'); //set user_role to administrator
    

    Enjoy !!!