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
4 Answers
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 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');
I had implemented this solution when I was stuck in same issue.
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.
Step by step tutorial here, VERY EASY!
https://codex.wordpress.org/Resetting_Your_Password#Through_FTP
To reset your password using ftp
download function.php file of your activated theme.
put this function
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 !!!