So your website has been hacked and you can’t log in. Your database offers a convenient backdoor to help you regain access to your WordPress Administration Screens.
Website hacking is a nightmare to businesses and web developers alike. WordPress websites come with strong security protocols which are not easy to bypass. But still they get taken down by hackers. Users also forget their passwords and sometime the user email becomes invalid or hacked itself. You try to log in using several password and username combinations but nothing works. And then you lose your sleep and also fear losing your online business.
In a previous tutorial, we discussed How Hackers Gain Access to a WordPress Website. In this tutorial, we will show you how to recover your WordPress Admin Screen in case you got hacked.
The Threats for WordPress
Almost every WordPress website come under attack. In fact, estimates suggest that hundreds of WordPress websites are attacked every minute. One of the most common forms of attack are Brute Force attacks where attackers use bots to try and decipher your account passwords. Once they get access to your account, they can then install malware or just disrupt the site services and even take down the site entirely. If you did not have a site backup you would loose all your website’s data.
But all is not lost! There is still a way to recover your website by changing your username while accessing your database. You have to sign into phpMyAdmin and carry out the changes before you can recover or restore your website.
Below are the steps required to change your password and get back into your WordPress Admin Screens.
Step 1. Log in to phpMyAdmin
If you don’t already have a strategy in place for regular backups of your website, you can still backup your database using phpMyAdmin. It is important to have a backup your Database before you make any changes. After the backup process is over, you can login to your Website via cPanel go to Databases > phpMyAdmin and then log into phpMyAdmin. Next, look at the left side and choose your website’s database. From the list, scroll down and select wp_users table.
You will have to look for your Admin username here. Once you find it, click on the Edit tab located on the same line.
Step 2. Edit the Email Address
Your current email address will be displayed in the user_email field. Change this field with an email address which you can log into and access. After you have successfully entered your email address, select the Go button located at the bottom part of the window.
Step 3. Analyze and Restore your Website
Enter the login page URL of your website or navigate to it manually. You will see an option which says- Lost your password? under the sign-in box. Click on it and enter the email that you just entered in phpMyAdmin. Then select Get New Password.
Step 4. Check Your Email
Open your email inbox to find the link to set a new password. Remember to make your password strong enough so that it can survive another hacking attempt.
Tips to prevent hacking and other attacks
- You can recover your content and database if website gets hacked or corrupted
- Try to make regular backups of the whole website (files and Database)
- Always keep the WordPress version updated for improved security and performance
- Use professional tools to check your website for malicious codes or other intrusions
How To Backup The Database Using cPanel?
It is best to create regular backup of your WordPress website. You can recover your website by using the backup file anytime it gets attacked. Let’s discuss on how to make backups now.
# 1. Use cPanel to Export The Database
From cPanel go to Databases > phpMyAdmin and look for your website’s database on the left side. Then click on it and choose the Export button at top of the window.
The Quick setting is sufficient for backing up the database. Click on ‘Go’ and select the destination target to save the file.
# 2. Restoring the Database
In case you want to restore the database of your Website, use cPanel and navigate to phpMyAdmin and select your database. Then from top of the window choose the ‘More’ tab. And then you will get a drop down menu, click on Import.
# 3. Choosing the backup file
Now you have to find the backup file saved earlier on your computer. Select the ‘Choose file’ tab, browse and get the backup file. Then tick on the ‘Go’ button to perform the recovery process. Your Website will retain everything from the last backup you created.
Boutros AbiChedid, the owner and main contributor to this Blog, wrote 1 tutorial that specifically talks about a Complete Backup of Your WordPress Website in 2 Simple Steps.
This tutorial showed you How to Get Back Into the WordPress Admin Screen after your Website was Hacked. Hopefully after reading this blog you would have heaved the sigh of relief!
If you have anything else to say, please share your opinion in the comments section. Your opinion matters, unless it is a Spam.
More WordPress Security Tutorials
Boutros AbiChedid wrote several tutorials on WordPress security, some are listed below: