Add or upgrade a user in WordPress to Administrator

Add or upgrade a user in WordPress to Administrator

Tags
WordPress
Published
December 3, 2023
Author

Add WordPress Admin

  1. Open phpMyAdmin
notion image
  1. Select your database
      • wp_environment — Primary database for this environment
  1. 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.
  1. Click Insert at the top
  1. 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)
  1. Click Go at the bottom
  1. 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.
  1. On the left hand menu click wp_usermeta
  1. Click Insert at the top
  1. 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;}
  1. Click Go at the bottom
  1. 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.
  1. Click Insert at the top again
      • user_id – Same ID from step 8
      • meta_key – wp_user_level
      • meta_value – 10
  1. 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.