Sometimes you need to gain admin access to your WordPress site. There are a number of reasons for when this might become an issue:-
- Lost password and no longer have access to admin email address
- No longer have access to the developer who was the only admin
- Developer has left your company
- Log into phpMyAdmin
- Make sure you select the database for your WordPress site in the left-hand column
- Click the _users table
- Click the Insert tab
- Fill in the following fields.
- ID - any number you choose that isn't already in use
- user_login - username for accessing the WordPress Dashboard.
- user_pass - password for the user. You must select MD5 in the functions menu
- user_nicename - nickname for the user
- user_email - email address you want to associate with this user
- user_registered - date and time for when this user is registered
- user_status - set to 0
- display_name - name that will be displayed for this user on your site
- Click the Go button
- Click the _usermeta table
- Click the Insert tab
- Fill in the following fields:
- user_id - ID you entered in the previous step
- meta_key - enter wp_capabilities (If you have setup your site to use custom database table prefixes, then you need to include that prefix here (e.g. {CustomPrefix}_capabilities). You can see the prefix in name of each database table in the left-hand column on the current page.
- meta_value - enter a:1:{s:13:"administrator";s:1:"1";}
- Click Go
- Click the Insert tab again
- Enter the following information:
- user_id - same number you entered in the previous step
- meta_key - enter wp_user_level
- meta_value - enter 10
- Click the Go button.
You can now login with the new Admin user