Ever need to add a new user without logging into the WordPress Dashboard? You can do this by editing your WordPress theme’s functions.php file.
Creating a new user through the functions.php file
To add a new user without logging into your WordPress dashboard, you can use an FTP to edit your functions.php file to add a new user.
- Connect to your server through a FTP client such as FileZilla;
- Open your WordPress theme’s function.php file (this is often located in public_html > wp_content > themes > your_theme_folder;
- Copy and paste the code below and upload the saved file.
Security warning for test users!
If you’re just testing the above function, please note that the code creates a new user altogether. Therefore even after removing the function, you must delete the new user from WordPress by navigating to Users from your WordPress Dashboard.