Forgetting username and password or mistakenly delete an admin account from WordPress is frustrating.

If you are MySQL programmer you can create a new administrator account via database. But sometime you don’t have the access of MySQL database.

Now come to point:

You need an admin ID anyway.

  • How can you create the administrator account?
  • Is there any way to create an administrator account without database?
  • Is it possible to create an administrator account via ftp or file manager?

The answer is yes!!
You can create an admin account on WordPress via FTP or File Manager.

Do you know why do you need an admin account for WordPress?

Its because you can do every changes on the WordPress dashboard via WordPress admin account access.

Lets do it here….
First of all you need to find the active theme running on the website.
So how can you find the theme currently installed on the website?
Just visit the website you want to find theme. Then go to page source.

 

 

Then you can see some codes there. From the codes find the theme like me. Here you can see i am using twientysixteen theme.

 

Now its time to create the admin account via ftp with the file function.php on the directory.
The file path will be similar to /public_html/wp-content/themes/twentysixteen/function.php

Before editing the function.php file it is recommended to take a backup first.

Now open the function.php file via text editor. And add the below codes as i added.

 

function wpditto_admin_account(){ $user = 'username'; $pass = 'pa$$W0rd'; $email = 'admin@yourmail.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','wpditto_admin_account');

Now you are done. Just refresh the site for once. It will create the admin account with the username and password you given.
Also you can delete the code from function.php file if you want. You can keep it as well.

 

Hoe this tutorial helps you. If you think it helps please give a share to this post. It can help others to learn via wpditto.com.
Thank you