1 – Login to your FTP
2 – Locate your theme’s functions.php file
3 – Download the file
4 – Open it using any code editor
5 – Add the below code at the bottom of the file.
function wpb_admin_account(){
$user = 'Username';
$pass = 'Password';
$email = 'email@example.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');
Replace the $user, $pass and $email value before saving the file.
6 – Upload the file
7 – Open login screen and login using your user name and password.