So, you got locked out of WordPress Admin Section? We won’t lie to you, the situation is scary for most people. They’ve gotten used to having the ability to control every single part of their website inside their browser. Losing that option is understandably terrifying. But, even though the situation is dire, there are multiple troubleshooting steps to get back into the WordPress Dashboard again. All you require is patience, calmness, and the will to test things out. Don’t worry, we’ll guide your hand through the entire process. Without further ado, let’s delve into it.
First, why can’t you access the WordPress Admin Dashboard? We can’t tell you exactly – it’s up to you to connect the dots. However, these are the things that often cause the problem.
1. You forgot your WordPress Admin Section password
So, you tried to access the WordPress Admin Section and the login credentials don’t seem to work? In that case, you have four options:
- Reset WordPress password using email.
- Reset WordPress password without the email.
- Use PhpMyAdmin to reset the WordPress password.
- Use Softaculous to reset the WordPress password.
2. A recent plugin or theme you installed caused a conflict
If the issue appeared overnight, it might be the theme you installed or plugin you installed recently. Or, it could be that you recently changed settings, and a wrong configuration caused a problem. Since you can’t access the Dashboard, you’ll have to use FTP to erase plugins and delete themes in WordPress. Or, at least disable them temporarily. The process is identical for plugins, you only look inside the wp-content/plugins folder instead of wp-content/themes.
3. You changed, then forgot your WordPress Admin Section permalink
It is recommended to change the default permalink from yoursite.com/wp-admin to a custom one. This prevents bots from spamming or people from trying to brute-force into your WordPress backend. However, if you can’t recall what you changed it to and adding a bookmark slipped from your mind, you’re in trouble. The situation is easily fixed, though.
- Use the steps for installing a WordPress plugin via FTP.
- Go to wp-content/plugins folder in your FTP client/cPanel.
- Find the folder named the same as the security plugin you used.
- Rename the folder to something else.
For example, from changewp-adminlogin to changewp-adminlogin-Inactive. - It will now be disabled, and you can access the Admin Dashboard using the default link.
- Feel free to enable the plugin after the matter is resolved.
4. You lost administrator privileges and need to reinstate them
This is common when you’ve been hacked, or when a malicious plugin or theme made significant and dangerous changes. For maximum security, you should create a brand new user, then make him an administrator with full privileges. Here’s how.
- Log in to your cPanel on your hosting website.
- Look for a web app named PhpMyAdmin and open it.
- In the menu in the upper left corner, select your WordPress database.
There’s no default name, but it’s usually the first option with a (+) sign that allows you to expand it. - You’ll know you chose the right option if you can find two tables, wp_users, and wp_usermeta.
Your hosting might use a different prefix instead of wp_ but the remainder will be the same. - Click on Insert in the available options for wp_users.
- Now, fill the table form making sure to put the right information in the right fields.
- ID – A number higher than the current number of users.
If you have 7, you can choose 8, 9, or a much higher number to be safe. - user_login – An username that’s not already in use.
- user_pass – A password that will correspond to the username you chose.
Make sure to enable MD5 under function. - user_nickname – Your full name or nickname. This is optional.
- user_email – The e-mail address you want to tie to the admin account.
- user_url – your website’s URL (link).
- user_registered – Select the current date.
- user_status – Enter a zero (0).
- display_name – The name that will be displayed throughout the website frontend and backend. It can be the same as the nickname if you entered it above.
- ID – A number higher than the current number of users.
- Save changes.
- Move over to wp_usermeta and click on Insert again.
- unmeta_ID – Automatically generated, leave it blank.
- user_ID – the same ID you entered above.
- meta_key – Type “wp_capabilities” without the quotation marks.
- meta_value – Type “a:1:{s:13:”administrator”;b:1;}” without the quotation marks at the beginning and end. We suggest that you type this manually instead of using copy-paste to ensure the right curly quotes are inserted.
- Click on Go or Next button in the bottom right corner to add another meta.
You might have to repeat step #8 if it returns you to the previous screen. - This time, enter:
- unmeta_id – Leave it blank again.
- user_ID – The same ID you used two times already.
- meta_key – Type “wp_user_level” without quotation marks.
- meta_value – Type “10” without quotation marks.
- Click on Go or Next again.
- Access the WordPress Admin Dashboard with the account you just created.
5. You got locked out after you tried to log in too many times
It was wise of you to install a security plugin to prevent repeated login attempts, thus stopping people or bots from trying to break in. The problem arises when you’re the “culprit”. Fixing the problem is easy – follow the steps we mentioned under cause number 3. After you disable the plugin and successfully log in, consider doing 4 things:
- Go to the plugin’s configuration page, and add your administrator account to the whitelist.
- If you have a static IP address or use a VPN with a static IP address, consider adding that to the whitelist.
- If your plugin doesn’t support those features, look for an alternative.
- Contact the plugin’s developers and ask whether they plan on adding these features.
6. Your website crashed
Oftentimes, when your website gets a white screen of death error, also known as “This site is experiencing technical difficulties” error in newer versions of WordPress, you get locked out of Admin Dashboard as a consequence.
7. You got an “error establishing database connection” problem
Once again, we have covered this issue in detail in our guide on how to fix “Error establishing a database connection” in WordPress.
8. A mistake in code caused “Parse error: Syntax error”
Finding a code that adds a neat function, then doing a copy-paste to your functions.php file is great. Besides adding cool bells and whistles, it can also sometimes replace the functionality of an entire WordPress plugin. It gets problematic when:
- You made an error in code trying to write it yourself.
- You used copy-paste but missed a bit of code.
- Misunderstanding happened, and you pasted the code below the closing PHP tag (?>).
- The original code might have been incorrectly written to begin with.
The “Parse error: Syntax error” will tell you exactly what the file path is, which line the error is on, and what caused it. For example, if it says expecting ‘)’ it means you forgot to add that character. This is how to fix it:
- Connect to your website’s root folder via FTP once again.
- Open the base folder (root, www, public_html).
- Follow the file path provided by the syntax error.
If it’s functions.php, look for it in wp-content/themes. - Right-click on the file, and choose View/Edit from the list of options.
- Try to fix the code using the instructions you received.
- If you aren’t sure how to fix the issue, it’s best to remove the entire code to restore functionality. This gives you time to:
- Test things out using a child theme before you make it official.
- Contact the website you took the code from.
- Ask or hire someone to do it for you.
9. Turn on PHP Errors in WordPress
We wrote a step-by-step tutorial on how to turn off PHP errors in WordPress because they’re annoying if things work properly. In this case, they’re a life-saver.
- Follow the same steps to find “wp-debug”.
- Make sure the line says:
define(‘WP_DEBUG’, true); - Replace false with true if a line like this exists.
define(‘WP_DEBUG_DISPLAY’, false); - If it doesn’t, you can copy-paste it anywhere above the line /* That’s all, stop editing! Happy blogging. */. Don’t forget to replace false with true.