How to add an administrator user in WordPress using FTP: a detailed guide

Using a version control system and automated deployment system is essential during WordPress theme development and administration. And when you're locked out of the WordPress admin area, adding an admin user using FTP is a quick and effective solution. In this article, we will detail how to add an administrator user in WordPress using FTP to help you regain control of your website.

Image[1]-How to add an admin user in WordPress using FTP: Detailed Guide - Photon Flux Network | Professional WordPress Repair Service, Global Reach, Fast Response

When to add an admin user to WordPress using FTP

  1. Loss of administrator access: When you can't access the WordPress admin dashboard due to forgetting your password, a security plugin locking you out, or a plugin/theme issue, you can create a new admin user via FTP to regain access.
  2. Broken WordPress: When encountering common WordPress errors that prevent you from accessing the admin dashboard, creating a new admin user via FTP can help you regain control.
  3. security issue: If your site is hacked and the hacker gains administrator access, you can kick them out and protect your site by creating a new administrator user.
  4. Migration issues: When moving a site to a new server, if the administrator user is not working properly or you need to reset information, you can use FTP to create a new administrator user to solve the problem.

How to Add a New Administrator Account in WordPress Using FTP

1. Preparatory work

First, you need an FTP client software, which will be used in this article. FileZilla. After downloading and installing the FileZilla client, you need to connect to your web server. Need your FTP access details, which can usually be found in your hosting control panel (e.g. cPanel) is found in.

Image [2] - How to add an admin user in WordPress using FTP: Detailed Guide - Photon Flux Network | Professional WordPress Repair Service, Global Reach, Fast Response

2. Connecting to your website

Open FileZilla, enter your FTP hostname, username, password, and port number, and click "Quick Connect". After successfully connecting, you will see the website file directory.

3. Find the functions.php file

In the right-hand window of FileZilla navigate to the public_html/wp-content/themes/your-current-theme/ folder. Find the current WordPress theme's functions.php Documentation.

Image [3] - How to add an administrator user in WordPress using FTP: a detailed guide - Photonflux.com | Professional WordPress Repair Service, Global Coverage, Fast Response

4. Edit the functions.php file

right click functions.php File and select "Download" to save it to your computer. Open the file in a plain text editor such as Notepad and add the following code snippet to the end of the file to create a new administrator user:

function wpb_admin_account(){
    $user = 'Username';
    $pass = 'Password';
    $email = 'email@domain.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','wpb_admin_account' );

Be sure to replace the information with your own Username,Password respond in singing email@domain.comThe

5. upload the modified functions.php file

Save the modified functions.php After the file, go back to FileZilla, find the file you just edited in the left window, right-click and select "upload" Select "overwrite" option and confirm.

Image [4] - How to add an administrator user in WordPress using FTP: Detailed Guide - Photon Flux Network | Professional WordPress Repair Service, Global Reach, Fast Response

6. Access to the WordPress admin area

Image [5] - How to add an administrator user in WordPress using FTP: Detailed Guide - Photon Flux Network | Professional WordPress Repair Service, Worldwide, Fast Response

Open in your browser yourwebsitename.com/wp-admin, log in using the newly created administrator account. If the code works, access to the WordPress admin area will be regained.

7. Deletion of code snippets

After logging in, open it again with the FTP client functions.php file and delete the code snippet you just added. Deleting the code does not delete the user account, it just prevents the code from being executed again.

Alternative: Add a new administrator user using the web host's file manager

If the FTP connection fails, you can use the File Manager feature in the hosting control panel. Take Bluehost as an example:

  1. Log in to the Bluehost Control Panel, navigate to the "Websites" tab, find the WordPress website and click "Settings".
  2. Scroll down to "Quick Links"section, click on "file manager".
  3. locate functions.php file, right-click and select "compiler".
  4. Paste the above code snippet and save the changes.
  5. Log in to your WordPress site with a new admin user and delete the code snippet.

Learn more about WordPress functions.php Hacks

In addition to adding a new administrator user, the functions.php The file performs many useful customizations, such as adding new widget areas or disabling automatic update notifications.

Image [6] - How to add an administrator user in WordPress using FTP: a detailed guide - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response

summarize

With the detailed steps outlined in this article, it is possible to use FTP to quickly add a new administrator user and regain control of your website when locked out of the WordPress admin area. Whether you're using an FTP client or a file manager in your hosting control panel, the key is to perform the steps precisely and remove the added code snippets promptly after completion.


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
Author: xiesong
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments