Add WordPress Admin User with phpMyAdmin
You can create a new WordPress admin user directly from the database. Use this method if you need to add a new user to the site without having to sign in to the WordPress dashboard.
Add WordPress Admin
- Open the User Portal
- Select the Environment name to edit
- Click phpMyAdmin at the top
- Select your database
- wp_environment — Primary database for this environment
- snapshot_environment — Legacy Staging database for this environment
- Select the wp_users table
- If you have a custom database prefix this will instead be yourprefix_users. Be sure to take this into account in later steps as well.
- If you have a custom database prefix this will instead be yourprefix_users. Be sure to take this into account in later steps as well.
- Click Insert at the top
- Fill out the required new user data
- ID — Enter any available ID number. You’ll need to know this ID number later!
- user_login — The username for this user.
- user_pass — The raw password the user will login with.
- NOTE: The function dropdown to the left must be set to MD5 or the password WILL NOT WORK.
- user_nicename — The author slug or name (EX: your-name).
- user_email — The email address associated with this user.
- user_status — Set this to 0
- display_name — The display name for the user (EX: Your Name)
- Click Go at the bottom
- Click Go again on the query page
- You should get a green check mark and success banner.
- If you get a red error at the bottom the user has not been inserted. Follow the error message to correct the issue until you are successful.
- On the left hand menu click wp_usermeta
- Click Insert at the top
- Fill out the following required fields for user capabilities:
- user_id — Same ID from Step 8
- meta_key –
wp_capabilities
- meta_value —
a:1:{s:13:"administrator";b:1;}
- Click Go at the bottom
- Click Go again on the query
- You should get a green check mark and success banner.
- If you get a red error at the bottom the user has not be inserted. Follow the error message to correct the issue until you get a success.
- Click Insert at the top again
- user_id – Same ID from step 8
- meta_key –
wp_user_level
- meta_value –
10
- Click Go at the bottom
You should now be able to access the site with your new admin user. If you have issues recheck that each step is done exactly as described.
If you have a custom database prefix, ensure you’ve done each step in the respective custom prefix table name.
Additional Notes
If your newly created user is unable to use the visual editor within WordPress after creation, ensure the visual editor is not disabled. This can be set in two ways:
From the admin dashboard:
- Login to the WordPress admin dashboard with your new user
- At the top right, click your username
- Click Edit my profile
- Ensure Disable the visual editor when writing is not checked
Or, from the database:
- Open the usermeta database table
- Click Insert
- user_id – Same ID from step 8 previously
- rich_editing –
true
- Click Go
NEXT STEP: Read about User Portal Roles