This solution enables you to add a new user via your functions file.
The code enables you to set the following:
- The username
- The password
- The email address
- The role
You can use this code to create a new administrator or add any number of users via your functions file, a plugin, theme or MU folder.
If, for some reason you cannot reset your password, you might want to use this solution.
Simply add the following PHP to your functions file and it will create a new user with administrator access:
Was This Tutorial Helpful?