Add a WordPress Admin with FTP

Είστε διαχειριστής σε and locked out of the admin panel? There are many different ways to recover your account, and the simplest may be to reset it access. Another way is to add an administrator through MySQL.

What happens if you do not have access to MySQL or do not have the necessary permissions to run querys? Below we will see how to add an admin user to WordPress using FTP.WordPress functions

The first thing you will need is an application FTP client.
With the application and after you provide the necessary information, you can connect via FTP or SFTP to the server hosting your page.

Once connected to your WordPress site, you should find the functions.php file located in the of your WordPress. It is usually on the route:


Download the functions.php file on your computer.

Open functions.php with your favorite text editor (we use Notepad ++ on Windows and Geany on Linux systems). Add the following code to the bottom of the file.

function iguru_admin_account(){
$user = 'Username';
$pass = 'Password';
$email = '';
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' );
} }

Don't forget to replace Username, ton (Password) και το με τα δικά σας .

Then save the file and then upload it back to your website using the FTP client.

Now you can sign in to your website with the account of the user you just added.

After you have logged in to your site, edit the functions.php file again to delete the name, password, and email you have added. Delete all of the above code. The Best Technology Site in Greecefgns

Subscribe to Blog by Email

Subscribe to this blog and receive notifications of new posts by email.

Written by Dimitris

Dimitris hates on Mondays .....

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).