Are you locked out of your WordPress website? Are you unable to regain access to your site? We can imagine the panic and frustration of this situation.
Although there are various reasons, one of the most prominent one is a hack. If a hacker has taken control of your website, it’s imperative that you act fast to regain control of your website. To verify if it’s a hack, you must immediately scan your site.
A compromised website adversely impacts your business and reputation. After gaining access to your website, hackers run all sorts of malicious activities such as stealing sensitive data, defrauding your visitors, running malicious ads and selling drugs on your site.
Depending on how you were locked out, there are multiple ways to regain access to your WordPress Site. Here, we’ll take you through the possible reasons why you could be locked out and give you solutions for each problem.
To overcome being locked out of your website, activate the MalCare plugin on your site. It gives you an independent dashboard that will allow you to fix hacked WordPress sites even if you’re locked out of your admin account.
Reasons Why You’re Locked Out Of WordPress And How To Fix It
There are multiple reasons why you could’ve been locked out of your WordPress website. The key to resolving the issue quickly is to identify the problem first. And you can do that by spotting the symptoms. Let’s take a look:
1) A Hacked Website
Are you locked out of your WordPress admin but you can still visit your website? There are chances that hackers after gaining access to your website, had made themselves admins and revoked your admin privileges. You get locked out, however, they continue to run your website.
If you suspect your site has been hacked, look for obvious signs. Some of them include:
- Your site’s content has changed.
- There’s spam on your website.
- Your site ranks for illegal drugs or counterfeit products.
- Your site redirects to another site.
How To Fix A Hacked WordPress Website?
Considering you’re locked out of your website, you have limited options:
1. If you are a BlogVault client, you can access the independent dashboard. Here, you can scan your site under ‘Security’. Once it locates the hack, you can clean it instantly by clicking on auto-clean.
Your site will be hack-free in under a few minutes. In case you face issues, you can contact the BlogVault support staff 24×7.
2. If you’re locked out without any independent dashboard like BlogVault, you can try different options:
Once you fix your website, we recommend taking security measures such as always keeping a security plugin active and hardening your site.
2) Error Establishing Database Connection
When a visitor comes to your website, your site makes a request to the database for content to display. It fetches this content and produces the page that we see on our screens.
When you try accessing your site, if you see an error, like so:
This means your WordPress site is unable to connect to your database. So it cannot fetch the content that’s required to display your website.
This can happen for many reasons:
- Your database is damaged or corrupted.
- There’s an issue with your host’s web server.
- Your wp-config file (which stores your database information) is incorrect.
- Your site is receiving a spike in traffic that causes your server to be overloaded.
How To Fix ‘Error Establishing Database Connection’?
We recommend contacting your web host first. In most cases, they will resolve the issue for you in a few minutes from your host account. If they are unable to do so, then you need to take other measures like repairing your WordPress Database. We recommend referring to our guide: How to Repair WordPress Database.
3) White Screen Of Death
Are you seeing a blank white screen with no error message? This is called a white screen of death. It causes panic among WordPress users quite often because there’s no error message. It’s much harder to figure out what’s wrong.
The reason you’re seeing a white screen of death could be:
- You’ve exhausted your website’s memory limit.
- You’ve installed a poorly coded theme or plugin on your site.
- There’s an issue with your web host.
How To Fix The White Screen Of Death?
1. Clear your Cache
We advise you to clear your WordPress cache. Sometimes the problem resolves on its own. However, if you have a caching plugin active, you would continue to see the white screen of death.
2. Check your Email
Next, check the inbox of your WordPress admin email. In most cases, you would receive an email from your web host detailing the problem with your website. They provide you with a link that will allow you to log in to WordPress in recovery mode. This will help you get temporary access to your site to fix the issue such as deactivating the faulty plugin.
3. Deactivate Plugins/Themes using FTP
If you don’t receive an email, you can connect to your website using FTP. We recommend downloading and installing Filezilla onto your computer. Here, you need to enter your FTP credentials.
Once you establish a connection with your site, you can deactivate all your plugins. Go to public_html > plugins.
Rename the ‘plugins’ folder to ‘plugins-deactivated’. This will disable all the plugins on your WordPress site. Now, try accessing your WordPress website. If your site is working, you can enable your plugins for WordPress one at a time to find the faulty one.
In the same way, deactivate your themes folder as well. Once you regain access, activate your theme to see if it was the cause of the problem.
4. Increase your Memory Limit
Lastly, you can increase your memory limit. To do this, you need to access your wp-config file. Connect to your website using FTP and access public_html > wp-config.php.
Download and edit this file in any text editor.
Just before the line that says ‘That’s all, stop editing! Happy blogging.’
define ( ‘WP_MEMORY_LIMIT’, ‘256M’);
This code tells WordPress to increase the PHP memory limit to 256MB. Once done, save and upload the file back to your website using the same FTP. Your site should be restored now.
Also Read: How to fix WordPress keeps logging me out?
4) Incorrect Password
You may find yourself locked out because you entered the wrong combination of username and password. This can happen because you have limited login attempts enabled on your website.
For example, if you activated the BlogVault plugin on your site, it automatically implements limited logins. This means if a user enters the incorrect username or password wrong more than three times, the failed login will lock them out of their account.
How To Fix Incorrect Password
To regain access, you need to use the ‘Lost password’ option to set a new WordPress password. A link will be sent to your registered email ID which will enable you to reset your credentials.
If you’re confident you’re entering the right credentials to your account but it’s prompting you that it’s incorrect, then it’s likely that your site has been hacked. Refer to our guide on how to clean up your hacked site.
5) Lost Admin Privileges
In some cases, you are able to login to your WordPress website, however, you don’t see admin functionality. This means you have lost your admin user permissions. For example, you can only view posts and pages, but you can’t see themes, plugins and other functions.
Again, this can be a sign of a hacked site. Hackers infect your site and seize control of your website
How To Fix ‘Lost Admin Privileges’ Issue
To fix this, we recommend using our professional malware removal services. Contact BlogVault and get your site restored to normal in no time.
If you are tech-savvy and know your way around cPanel, you can also try to add yourself as an admin user via phpMyAdmin. This method is risky and any small error can break your site. We don’t recommend using this method. Please take a complete backup of your WordPress website before attempting this.
Refer to our article: How Can Hackers Hack Your WordPress Site. Here, we show you how to add a new user using your database.
Getting locked out of your website can be the cause of a great deal of panic and frustration. We hope this guide has helped you solve the issue and get your website back to normal.
In our experience, a hack is the most common reason for being locked out of WordPress. It’s imperative that you take security measures on your website as soon as possible.
First, always backup your WordPress site. In case things go wrong, you can quickly restore your website to normal. We strongly recommend using BlogVault because it gives you a complete WordPress backup of your website and is guaranteed to work when you want to restore it.
Plus, it’s independent dashboard gives you access to your site even in times when you find yourself locked out. The plugin will also scan and monitor your site for hack attempts and suspicious activity. You can have peace of mind knowing your site is safe.
Backup and Secure your Website with BlogVault!