To set a WordPress user to Admin privileges directly in the database via phpMyAdmin, follow these steps carefully:

Step 1: Log into phpMyAdmin

  1. Access phpMyAdmin from your hosting control panel (e.g., cPanel, Plesk, etc.).
  2. Select the database associated with your WordPress site.

Step 2: Locate the wp_users Table

  1. Open the wp_users table (the prefix wp_ might be different depending on your WordPress setup).
  2. Find the row corresponding to the user you want to edit (look at the user_login or user_email column).

Step 3: Locate the wp_usermeta Table

  1. Open the wp_usermeta table.
  2. Look for the entry where:
    • user_id matches the ID from the wp_users table.
    • meta_key is wp_capabilities (or a similar prefix like customprefix_capabilities).

Step 4: Update the User Role

  1. If the wp_capabilities entry exists for the user, edit it. If it doesn’t, create a new row:
    • user_id: The ID of the user from the wp_users table.
    • meta_key: wp_capabilities (or your table prefix + _capabilities).
    • meta_value: Set the value to: a:1:{s:13:"administrator";b:1;}

Step 5: Set Admin-Level Permissions

  1. Ensure the user has an entry with the meta_key wp_user_level (or equivalent prefix):
    • If it doesn’t exist, create it.
    • Set the meta_value to 10 (this is the administrator level).

Step 6: Save Changes

  1. Save your updates to the table.
  2. Clear your site’s cache (if applicable) to ensure the changes are reflected.

Step 7: Test the Login

  1. Log in to WordPress with the user’s credentials.
  2. Verify they have administrative access.

Elementor Logo

Elementor Credentials

Crocoblock logo

Crocoblock Subscription Key