How to Fix WordPress Login Errors
If you’re experiencing WordPress login issues, such as a faulty theme or a redirect loop, there are a few things you can try. First, clear your browser cookies and cache. Click on the three dots in the top-right corner of your browser, then select “Clear browsing data”.
Next, disable all plugins by renaming their folders. Log in to your site and try to access the dashboard, one by one, until you find the faulty plugin.
1. Install the plugin
When you try to login to your WordPress dashboard, you might get a redirect loop error or an internal server error. These errors are often caused by a bug in one of your plugins. If you have a few different plugins installed, it can be difficult to find the one that’s causing the problem.
When a user attempts to login, WordPress saves an authentication cookie in the browser and parses it into a token and hash. This information is then compared to the hashed login data stored in the wp_users database for that username. If the two match, WordPress will grant that user access to wp-admin.
To pinpoint the cause of the problem, you can connect to your site’s cPanel and open the File Manager option. Then, navigate to the wp-content directory and open the plugins folder. Rename the folder to something else and then disable the plugins one by one until you find the one that’s causing the issue.
2. Add the reauth=1 parameter to your wp-config.php file
When you try to login to your WordPress site, the website performs a series of steps to verify that you are a legitimate admin. First, it sets an authentication cookie in your browser (wordpress_logged_in_[hash], or login). This contains your admin username, a hashed password, and a session token.
It then compares this information with the data stored in the wp_users table of your database. If it matches, it will grant you access to your dashboard and keep you logged in.
However, if these cookies are old and cached, they may interfere with the login process and cause a redirect loop. The easiest way to fix this is by clearing your browser’s cookies and cache. To do this, click the three dots menu in the top right corner of your browser and select History. Next, click Clear browsing data.
3. Update your WordPress installation
WordPress is constantly adding new functionality, and older code can break when it’s updated. Keeping your site up-to-date is a must to avoid security issues and ensure that all features work as intended.
Before updating, make sure that you’ve taken a full backup of your website and database files. You should also disable or deactivate any plugins that aren’t compatible with the latest version of WordPress.
During the update, WordPress will replace your current website files with the new ones. This may take some time depending on the size of your website. Once the update is complete, you’ll be able to log in to your dashboard.
Connect to your website’s cPanel and open the FTP window that displays your root directory (the part that contains the name of your website). Select all the files in the local site folder, including the wp-includes and wp-admin folders. Then, copy over the files in the downloaded WordPress folder to your web server, replacing them when prompted.
4. Reactivate the plugin
Cookies can interfere with the login process if they’re not functioning properly, which is why it’s important to make sure that both cache and cookies are enabled. If you’re still unable to log in, it could be a problem with a plugin. If you’re not sure which plugin is responsible, you can deactivate it by using FTP to connect to your server and navigate to public_html – wp-content – plugins. Rename the plugin folder to something else (e.g. plugins_test) and try to log in again. This will help you pinpoint the faulty plugin.
However, it’s worth mentioning that disabling XML-RPC is not as effective as preventing attacks or removing unauthorised access to your website. This is because attackers will simply use brute force techniques to break into your site, regardless of whether XML-RPC is disabled or not.