• Home
  • Computer Tips & Tricks
  • Game Tricks And Fixes
  • Internet Tricks
  • WordPress Tutorials
  • More Topics
    • Windows Tutorials
    • Andriod Tutorials
    • Adobe Tutorials
    • Youtube Tips And Tricks

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

How to Remove Write Protection from USB & SD Cards in Windows 11,10,8.1,8 & 7?

September 1, 2023

How to Fix the “A Newer Version of this application is already installed.Installation Stopped” Error in Coreldraw?

August 31, 2023

How to Fix the CORELDRAW “You cannot install this product because another version is already installed.”?

July 31, 2023
What's Hot

How to Remove Write Protection from USB & SD Cards in Windows 11,10,8.1,8 & 7?

September 1, 2023

How to Fix the “A Newer Version of this application is already installed.Installation Stopped” Error in Coreldraw?

August 31, 2023

How to Fix the CORELDRAW “You cannot install this product because another version is already installed.”?

July 31, 2023
Lets Make It EasyLets Make It Easy
  • Home
  • Computer Tips & Tricks

    How to Remove Write Protection from USB & SD Cards in Windows 11,10,8.1,8 & 7?

    September 1, 2023

    How to Fix the “A Newer Version of this application is already installed.Installation Stopped” Error in Coreldraw?

    August 31, 2023

    How to Create Windows 11 Bootable USB Drive Using Rufus?

    June 21, 2023

    How to Download Original Windows 11 Officially?

    June 18, 2023

    How to Fix “The PC must support TPM 2.0 & Secure Boot” Error While Installing Windows 11?

    June 15, 2023
  • Game Tricks And Fixes

    How to Fix “Error 173 – AMD Software Installer Cannot Proceed as No AMD Graphics Hardware Has Been Detected in Your System” Problem Quickly?

    June 5, 2023

    How to Fix Failed to initialize Direct3D error on Windows 7,8,8.1,10 & 11?

    March 31, 2023

    How to Download & Clean Install Nvidia Drivers on Windows 10 & 11?

    February 15, 2023

    How to Download & Install Nvidia Drivers (Older Versions) on Windows 10 & 11?

    February 15, 2023

    How to Fix GTA IV (GTA 4) SecuLauncher error 2000 in Windows 7,8,10 &11?

    February 14, 2023
  • Internet Tricks

    How to Fix JIO FIBER’s Red Light Blinking Problem Easily?

    April 26, 2023

    How to Repair a Corrupted MySQL Database Table?

    March 2, 2023

    How to Convert EPUB to PDF for Free Online & Offline?

    February 28, 2023

    How to Get Quick Adsense Approval for WordPress Blog/Website?

    February 27, 2023

    How to Remove/Delete Your Site from Ezoic Network?

    February 5, 2023
  • WordPress Tutorials

    How to Deactivate All WordPress Plugins & Themes when you are not able to access the WP-Admin?

    May 20, 2023

    How to Create WordPress Admin User in phpMyAdmin?

    May 18, 2023

    How to Fix “Rankmath Causes Critical Error: Instant Index Status Error undefined – There has been a critical error on this website.”Quickly?

    May 18, 2023

    How to Fix “Sorry, You are not allowed to access this page” Error in WordPress?

    May 16, 2023

    How to Add an Admin User in WordPress using FTP or cPanel File Manager?

    May 10, 2023
  • More Topics
    • Windows Tutorials
    • Andriod Tutorials
    • Adobe Tutorials
    • Youtube Tips And Tricks
Lets Make It EasyLets Make It Easy
Home » How to Add an Admin User in WordPress using FTP or cPanel File Manager?
Wordpress Tutorials

How to Add an Admin User in WordPress using FTP or cPanel File Manager?

AuthorBy AuthorMay 10, 2023Updated:May 15, 2023

Hi Guys, Today I am Going to Show You How to Add an Admin User in WordPress using FTP or cPanel File Manager?

If You’re Looking for the Commonly Searched WordPress Error “How To Create New WordPress Admin User Account Via FTP?” (or) “How to Add an Admin User in WordPress using FTP or cPanel File Manager?”.You are at the Right Place to Get Your Answers & Solve the Issue/Error. 

One of the Most Frustrating issues in WordPress is when you’re the actual Admin of your Website and you’re not able to log in to your Account. Your Website will show an error “Sorry, you are not allowed to access this page”. This Issue Happens due to many reasons such as a forgotten username and password, the active user account may get deleted, the Admin rights of the user getting removed, A User Account being deleted by security plugins (or) your site may have been hacked. This Issue needs to be fixed immediately to avoid further problems.

Trending
How to Fix Command Prompt Opens And Closes Immediately in Windows 10? | Why CMD.exe Closes Immediately Whenever I Tried to Open it?

The Easiest Way to Fix this Issue is to add a Temporary Admin User through FTP. This Temporary Admin User is used to log in to your account temporarily. After Logging in to your Account with this new temporary admin account, You need to Change the Admin Rights to the Original User Account. And then Log in to your WordPress admin panel with that Original Account. You must remove admin rights from the temporary admin account and delete the temporary admin account. And also remove the code also. If you’re new to WordPress, don’t worry follow our steps carefully. We provided a Step by Step Tutorial for Adding Admin User in WordPress through FTP or File Manager.

Trending Now : How to Fix “Error 195- AMD Software Installer Cannot Continue Because It Is Unable to Access the Required Web Resources” Problem Quickly?

 

Step 1: First of all, Goto your Website Hosting Site. Log into your Account and Open the C-Panel and Access the File Manager.

(or)

Step 1:You can Use the FTP Clients Like FileZilla,WinSCP or Cyberduck to Access the WordPress Files with your FTP Hostname, Username, Password, and Port Numbers. 

 Step 2: After Successfully Connecting, Navigate to the Root directory of your existing Worpdress Installation and Look for the public_html folder.

Step 3: Now Open the Public_Html Folder & Double Click on the wp-content & Look for the Themes Folder and Double Click on it.

Step 4: Just Locate the Currently Active Theme Folder (The folder of the theme that you’re currently using on your website.) and Double Click on it.

Step 5: Now You need to look for the functions.php file in the theme folder and Right Click on it and Select Edit to Edit the Functions.php file. 

*Note – Fore Safety Purposes, Make Sure to back up the File Before Editing. Because if something goes wrong after editing, We can use the backup file to bring it back to normal.

Step 6: Now You Need to Copy Paste the Following Code into the Funtions.php file.

Here I’m providing you two codes, you can try one by one and check which one works for you.

function create_admin_account(){
$user = 'Username';
$pass = 'Password';
$email = 'email id';
//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 a Admin
$user->set_role( 'administrator' );
} }
add_action('init','create_admin_account');

(or)

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

This Step is the Most Important Step and you need to follow it carefully.

Step 7: Now You Need to Replace the Username, Password, Email ID with your own details and Save the File.

Note – The Username, Password, and Email ID that you enter should be Unique otherwise the code may not work.

Step 8: Now Goto to your WordPress Admin and Log in with your Newly Created User Credentials.

*Important Note: After Logging into your account, You must remove the added code from the “functions.php” file because Leaving the code as it is will be a huge potential security risk.

 

You Can Follow these Optional Steps If you want

Step 9: Navigate to Users Section and Click the Add New Button to Create a New User and Give the Administrator Role and Press Update Profile.

Step 10: Now Log out from the Site and Log in with your New User Which you created from WordPress Users Section.

Step 11: Goto the Users Section and Remove the Admin rights for the user which you’ve created through funtions.php file and Delete the User.

That’s All About this Post. Give Your Reviews / Reactions about this Post and Leave Comments, Ask Your Doubts, We are here to Help You!

add admin user to wordpress site add admin user wordpress add admin user wordpress functions php how to add an admin user in wordpress using ftp Sorry wordpress create admin user programmatically wordpress functions add admin user you are not allowed to access this page
Previous ArticleHow to Fix “Update failed / Download failed. Could not open handle for fopen()” in WordPress?
Next Article How to Fix “Sorry, You are not allowed to access this page” Error in WordPress?
Author

Basically an Instrumentation Engineer But Very much Interested in Blogging. I'm a Passionate Blogger and an Expert in Search Engine Optimization And Always Looking Forward to Learn New Things. I Would Fix & Provide Solution to the Most Common Issues Related to PC,Laptops,Mobiles,OS, Hardwares and Softwares.

Related Posts

Wordpress Tutorials

How to Deactivate All WordPress Plugins & Themes when you are not able to access the WP-Admin?

May 20, 2023
Wordpress Tutorials

How to Create WordPress Admin User in phpMyAdmin?

May 18, 2023
Wordpress Tutorials

How to Fix “Rankmath Causes Critical Error: Instant Index Status Error undefined – There has been a critical error on this website.”Quickly?

May 18, 2023
Add A Comment

Leave A Reply Cancel Reply

Subscribe to Updates

Get the latest tech news from FooBar about tech, design and biz.

Most Popular
  • Trending:How to Remove Write Protection from USB & SD Cards in Windows 11,10,8.1,8 & 7?
    by Author|September 1, 2023
    0
  • Trending:How to Fix the “A Newer Version of this application is already installed.Installation Stopped” Error in Coreldraw?
    by Author|August 31, 2023
    1
  • Trending:How to Fix the CORELDRAW “You cannot install this product because another version is already installed.”?
    by Author|July 31, 2023
    0
  • Trending:How to Uninstall the Windows Updates Using WUSA And DISM Commands in Windows 11/10/8/7?
    by Author|July 18, 2023
    0
  • Trending:How to Fix the Inaccessible Boot Device Error on Windows 8,8.1,10,11?
    by Author|June 27, 2023
    0

Top Posts

How to Fix “Oops looks like the page is lost. This is not a fault just an accident that was not intentional.”Error?

April 26, 2023408 Views

How to Fix “Error 195- AMD Software Installer Cannot Continue Because It Is Unable to Access the Required Web Resources” Problem Quickly?

May 7, 2023289 Views

How to Configure Jio Fiber Router? | Reliance Jio Fiber Router JCO4032 Settings [ Updated ]

December 9, 2022266 Views
Editor's Pick
Internet Tricks

How to Configure Jio Fiber Router? | Reliance Jio Fiber Router JCO4032 Settings [ Updated ]

AuthorDecember 9, 2022
Adobe Tutorials

How to Fix “A low-level exception occurred in ImporterMPEG” Error in Adobe Premiere Pro?

AuthorDecember 9, 2022
Internet Tricks

How to Fix JIO FIBER’s Red Light Blinking Problem Easily?

AuthorApril 26, 2023
Adobe Tutorials

How to Fix “File importer detected an inconsistency in the file structure.Reading and writing this files metadata (XMP) has been disabled.” Error in Adobe Premiere Pro?

AuthorDecember 9, 2022
Latest Articles

The Ultimate Technology Site About Technical Support, Information Technology, PC Builds, Domain Hosting, WordPress, Blogger.Letsmakeiteasy is a site where you can learn about technology, Search Engine Optimisation, Computer and Mobile Tricks, Blogging and WordPress Tips. We are Here to Help You.

Most Popular

How to Fix “Oops looks like the page is lost. This is not a fault just an accident that was not intentional.”Error?

April 26, 2023408 Views

How to Fix “Error 195- AMD Software Installer Cannot Continue Because It Is Unable to Access the Required Web Resources” Problem Quickly?

May 7, 2023289 Views

How to Configure Jio Fiber Router? | Reliance Jio Fiber Router JCO4032 Settings [ Updated ]

December 9, 2022266 Views
Our Picks

How to Remove Write Protection from USB & SD Cards in Windows 11,10,8.1,8 & 7?

September 1, 2023

How to Fix the “A Newer Version of this application is already installed.Installation Stopped” Error in Coreldraw?

August 31, 2023

How to Fix the CORELDRAW “You cannot install this product because another version is already installed.”?

July 31, 2023
  • Home
  • About Us
  • Contact Us
  • Sitemap
Copyright © 2023 Letsmakeiteasy.tech LLC. All Rights Reserved. | Crafted With ❤️ | Created by Vasantharaj R N

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.