Step 1: Log into phpMyAdmin
- Access phpMyAdmin from your hosting control panel (e.g., cPanel, Plesk, etc.).
- Select the database associated with your WordPress site.
Step 2: Locate the wp_users Table
- Open the
wp_users
table (the prefixwp_
might be different depending on your WordPress setup). - Find the row corresponding to the user you want to edit (look at the
user_login
oruser_email
column).
Step 3: Locate the wp_usermeta Table
- Open the
wp_usermeta
table. - Look for the entry where:
user_id
matches the ID from thewp_users
table.meta_key
iswp_capabilities
(or a similar prefix likecustomprefix_capabilities
).
Step 4: Update the User Role
- 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;}
- user_id: The ID of the user from the
Step 5: Set Admin-Level Permissions
- 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
- Save your updates to the table.
- Clear your site’s cache (if applicable) to ensure the changes are reflected.
Step 7: Test the Login
- Log in to WordPress with the user’s credentials.
- Verify they have administrative access.