How to Add a WordPress Administrator User Using FTP

Creating a new WordPress administrator user is easy if you have access to your wp-admin panel. Sometimes, you might not have the privilege to your website or on a multi-author site.

There may be a case when you get a white screen of death, and you might require a new user account. And you know that only an administrator has the complete access to a WordPress website.

When having multiple users on the single site, you choose the different user roles. But when you’re the only one managing your WordPress site, you need an administrator account to fix an issue.

Suppose, you forget your login credentials and you also don’t have access to your email address. At such a situation, you require to create a new WordPress administrator user, which is possible using FTP.

If you have access to cPanel, you can also accomplish the same task using it. But this tutorial is about using FTP, which is more comfortable than the cPanel method.

Edit the functions.php File to Add a New WordPress Administrator User

I hope you know the process to connect your FTP account with your web server using Filezilla. Almost every company offers you to create an FTP account while installing WordPress.

If you already have an account, you can use it, or create a new one. For which, you need to use cPanel. But, if you already have an account, follow the steps.

How to Add a WordPress Administrator User Using FTP

Note: If you have multiple websites on the same server, you might need to open its folder.

Step 2:

The lower box in the right corner shows the files and folders,

search for the wp-content folder and click to open it
.

How to Add a WordPress Administrator User Using FTP

Step 3:

You may know that wp-content stores all the plugins, themes, and media files. From here, you need to

open the themes folder
.

How to Add a WordPress Administrator User Using FTP

Step 4:

You can see all active and inactive WordPress themes present on your website.

Open the active theme folder
. For example, it’s Blogginglove for my site.

How to Add a WordPress Administrator User Using FTP

Step 5:

Scroll down, and

you need to find the functions.php file. Right-click and choose the View/Edit option
.

How to Add a WordPress Administrator User Using FTP

Step 6:

A popup appears to select the text editor. By default, it picks the default text editor of your computer.

If you want to use a custom text editor, you can choose it by selecting it from the other radio button
.

How to Add a WordPress Administrator User Using FTP

I prefer to use the default text editor by clicking on the Ok button.

Step 7:

You may see another popup to authenticate the certificate. Click on the Ok button
and you can see the functions.php file in the text editor you choose.

How to Add a WordPress Administrator User Using FTP

Now, you can see the functions.php file in the text editor you choose.

functionnew_admin_account(){
$user = 'Username';
$pass = 'Password';
$email = 'email@domain.com';
//If a username with the email ID does not exist, create a new user account
if ( !username_exists( $user ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $user, $pass, $email );
$user = new WP_User( $user_id );
//Set the new user as an Admin
$user->set_role( 'administrator' );
} }
add_action('init','new_admin_account');

Add this code to the file.

Note: Don’t forget to replace the default Username, Password, and Email with your login credentials.

Save the file, and you’re good to go. Now, you can log in to your WordPress website using new credentials. Congrats, you have successfully created a new WordPress administrator account for your site.

Dealing with the common WordPress issues can be overwhelming, but when you know the alternatives, everything becomes convenient.

You may need to create a new user in many situations. Losing the login credentials is one of the most common scenarios, I forget them all the time.

I am sure, you may also have used a web hosting which didn’t provide access to cPanel.

Conclusion

Either you have the privilege or not, you can create a new WordPress administrator user using FTP. Within no time, you can solve your problem of not logging in to your WordPress site.

I hope you can understand the concept and use an FTP server to accomplish such a task.

Check out these top 3 WordPress hosting services:

HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8

How To Set up a VSFTPD Server on a CentOS 7 VPS or Dedicated Server

Brief Description FTP is usually insecure exposing clear-text passwords, userna
2 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Brief Description FTP data is usually insecure since information (usernames, pa
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Connect FileZilla to Manage Your Website using FTP

Most of the people rely on the direct access to the cPanel of their web hosting
4 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How to configure FlashFXP FTP client

This article shows you how to configure FlashFXP, a fast, secure FTP client that
2 min read
Idan Cohen
Idan Cohen
Marketing Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top