Add a WordPress Admin with FTP

Are you a webmaster on a WordPress site and locked out of the management panel? There are many different ways to recover your account and the simplest is perhaps to reset your password. Another way is to add an administrator via 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 logged in to your WordPress site, you'll need to find the functions.php file in your WordPress theme. It's usually on the way:

/http-content/themes/the-theme-page-of-the-functions.php

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 = 'email@iguru.gr';
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','iguru_admin_account');

Do not forget to replace the name (Username), ton code (Password) and email@iguru.gr with your own data.

  Wikileaks Vault 7: Pandemic or Pandemic

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.

Follow us on Google News iGuRu.gr at Google news

Written by Dimitris

Dimitris hates on Mondays .....

Leave a reply

Your email address is not published.

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.).


  + 56 = 64