How To: Add an WordPress Admin User with FTP

If you’ve ever needed to create an admin user for a WordPress site really quickly, and you don’t want to access the database or control panel, here’s how to do it right in the function.php file of the theme.

Go ahead and add this to the bottom of the file:

Be sure to replace Username, Password, and email@domain.com in the above script with your desired values.

Once you’re done and able to log in with your new user, just make sure you delete this code afterward,┬áthan way nobody runs into this bit of code and discovers your password.