Είστε διαχειριστής σε by clicking here Ltd. and locked out of the admin panel? There are many different ways to recover your account, and the simplest may be to reset it code 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.
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 theme of your WordPress. It is usually on the route:
/your-site/wp-content/themes/το-theme-που-useste/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');
Don't forget to replace Username, ton code (Password) και το email@iguru.gr με τα δικά σας data.
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.
