One of our users site got hacked and the WP Admin user account password was changed by the hacker. This essentially locked the user out of his admin dashboard. It is best (for situations like this) to just create a new admin user account to gain access to WP admin dashboard and fix things as needed.
In this tutorial I will show you how you can create a new WordPress admin user account via MySQL database (without having access to your WordPress admin dashboard).
Note: You can ONLY do this if you are the site owner. You need to have access to cPanel/Control Panel of your server (comes with your hosting plan). If you don’t know the details of your cPanel login then ask your hosting provider.
Step 1) Access Your MySQL Database
- Log into your cPanel/Control panel
- Go to “Database” section
- Click on PHPMyAdmin icon
Step 2) Go to the WP Users table
- Select your WordPress database from the list of databases in PhpMyAdmin
- Go to the WP Users table and click on the “insert” link
Step 3) Insert a New Record in the Users Table
You will need to fill in the following fields to insert a new user record:
- ID – Keep the value of this field empty (it will automatically assign the correct value for it)
- user_login – insert the username you want to use
- user_pass – add a password for the account. Select MD5 in the functions menu (Refer to the screenshot below).
- user_nicename – leave this field empty for now
- user_email – add the email address you want to use for this account.
- user_url – leave this field empty for now
- user_registered – select the date/time for when this user is registered.
- user_status – set this to 0.
- display_name – leave this field empty for now
- Click on the Go Button (you should see a success message)
You can go back to the wp_users table and browser the entries to verify that the user record has been inserted correctly (see screenshot below).
Take note of the value if the “ID” field for this newly created user (we will need this ID field’s value for the next step). In this case the ID is 2.
Step 4) Insert User Meta Values
This is the final step where we will assign some user meta values to the user account we just created.
Go to the “wp_usermeta” table and click on the “insert” link:
Use the following values and click the “Go” button to insert the usermeta data
- unmeta_id – Leave it blank (it will be generated for you)
- user_id – This is the ID of the user we created in the previous step. For our case it is 2.
- meta_key – Use wp_capabilities
- meta_value – Use the following value for this field:
a:1:{s:13:"administrator";s:1:"1";}
See screenshot below
All done!
Changing Your WordPress Admin Password Within Your Database
Issue
You've forgotten or lost your password for your WordPress admin account, and now you can't get in to edit your site.
Solution
There are four ways you can recover or change your admin password, and continue to work on your site.
Option 1: Use the WordPress Built-In Password Reset Feature
This option is the easiest. It requires the username or email address attached to the account that you are trying to reset the password for. It requires that you know the email address and password for the account associated with the WordPress admin account.
- In your URL bar go to http://yourdomainname.com/wp-login.php
- On this screen, click Lost Your Password?This will send a password reset link to your admin account's email address.
- Login to your email account for your admin account.
- Click the email from your WordPress site.
- Click the password reset link.
- On the next screen enter and confirm your new password click Reset.
- On the next screen click Log In.
- Use your admin username and the new password to login.
Option 2: Change the Password in the MySQL Database
This option requires knowledge of the Customer Control Panel, phpMyAdmin, and the WordPress database. It is not recommended to attempt this without familiarity in these areas. If you do not feel comfortable manually editing the database, or navigating the control panel, please follow the steps in Option 3.
- Login to your Control Panel.
- Click on the System tab up at the top left.
- Navigate to Websites & Domains.
- Click on Databases.
- Click on the database for your WordPress site.
- Click on WebAdmin.
- Click on the wp_users tableNote: Your database may have different prefixes on the tables, depending on how it was set up.
- Click on the Browse tab up at the top on the left side.
- Click on the user you wish to editNote: The edit button will be to the far left at the beginning of the row.
- In the password field, select MD5 for the type, and enter in your new password.
- Click Go at the bottom.
- Go to your site's login and try your new password. If all went as expected, your new password should work, and you can login.
Option 3: Contact Support for Assistance
This option is for that situation when you can't get to your site to use the lost password link, or when you don't feel comfortable editing your database manually.
- Log in to your Control Panel.
- Click the Help tab at the top.
- Click Trouble Tickets.
- Click Submit a Ticket.
- Click on SUPPORT: I have a technical issue that I need assistance with.
- Click Open a Ticket with the Support Team, then click next.
- In the application drop down, select the application you are using, in this case, WordPress.Enter in all of the information that you can provide in the fields provided.The only fields that are required are:
- What your domain name is
- What you are trying to do, in this case, you can leave it at the default, Control Panel
- You'r preferred follow up method
- Subject of the ticket
- The message explaining what you are trying to do, and what you need help with in this case, please include the username you are trying to reset the password for.
- Click Submit at the bottom.
- We will begin working on your ticket very soon and you will be receiving your reply as soon as we are done, or if we need more information from you.
Option 4: Use Control Suite's Update WordPress User Password Button
This option is only available to dedicated server customers.
- Log into your dedicated server using Remote Desktop.
- Double click on the Control Suite icon on your desktop.
- Login to Control Suite.
- Double click on the Plesk x.x.x (Domains) icon in the Navigation Tree.
- Double click on the [domain] that requires the password reset.
- Double click on WordPress x.x.x.
- Double click on Administrators. Click on admin.
- Click on the Update WordPress User Password in the Commands Ribbon.
- Type the new password in the Main Window and press Execute.
0 comments:
Post a Comment
Subscribe to Perfect BloggersTech by Email
Don't Spam Here ! You will Be Blocked Permanently