Everyone who uses WordPress sometimes finds themselves in a situation where access to the administration area (admin panel) is blocked. There can be many reasons - from plugin or theme errors, to database connection problems, to password problems. Below are specific solutions that will help you regain access to your WordPress admin panel.
1. Check your database connection
The first step is to check whether the problem is with the database connection. Errors may be due to incorrect login information or problems with the database server.
- Open file
wp-config.php
in the main WordPress directory. - Find and check the data in the section
MySQL settings
.
If everything looks fine but the problem persists, contact your hosting provider to see if there are any problems with your database server.
2. Deactivate plugins
Some plugins may cause conflicts that result in blocking access to the administration area.
To check this, log in to your FTP account (e.g. using FileZilla) and navigate to the directory wp-content/plugins
. Change the name of the plugin directory (e.g. to plugins_old
), which deactivates all plugins. If this solves the problem, you can activate the plugins one by one to find out which one is causing the conflict.
3. Switch to the default theme
The problem may be due to errors in the WordPress theme. To check this, you can switch the theme to the default one, just like you would when deactivating plugins. Go to directory wp-content/themes
and rename your active theme. WordPress will automatically switch to one of the default themes.
4. Reset password
If the problem is that you can't log in, you can reset your password. This can be done in several ways, e.g. via e-mail, if available, or directly via the database.
For database, login to phpMyAdmin, find the table wp_users
, click on your username and then change your password. Be sure to select the MD5 function from the drop-down menu - WordPress uses this format to store passwords.
5. Check the .htaccess file
File .htaccess
can be a source of problems, especially if you have recently made changes to your permanent link settings. To check this, log in to FTP, find the file .htaccess
in your WordPress root directory and rename it (e.g. to .htaccess_old
). If this solves the problem, create a new file .htaccess
and copy the standard WordPress rules into it.
6. Use the “Emergency Recovery Script” plugin
“Emergency Recovery Script” is a powerful tool that helps you solve many WordPress problems. It runs independently of WordPress, so you can use it when your admin area is locked. Thanks to this tool, we can reset the password, switch the theme to the default one, deactivate plugins, and fix file errors. wp-config.php
if .htaccess
.
Remember to always keep your WordPress and plugins updated after you resolve the issue to prevent similar issues in the future. If the problem still persists, it is worth seeking help from experts, e.g. through professional WordPress support services.