How to fix login page: wp-login.php redirects to wp-admin wordpresswp-admin&reauth=1
If you have the problem above, then here is the fix for you.
Upon logging in with correct credentials, I kept getting bounced back to the wp-login screen. The URL was each time appended as http://your website/wp-login.php?redirect_to=http%3A%2F%2Fyour website%2Fwp-admin%2F&reauth=1.
Here are all the things that you need tried:
- Clearing my cache, logging in in Incognito-mode, user other browsers, etc.
- Disabling all plugins by renaming the wp-content/plugins folder
- Disabling all themes except twentysomething
- Doing a complete re-upload of everything WP except wp-config.php and especially re-uploading wp-login.php
- Wiping the .htaccess file (Thank god I made a backup)
- Checking my database if it exceeded the allowed size (Mind you this has been a fix for several cases I encountered so make sure to check that!)
- Adding code to wp-login.php to re-specify my site URL, or, doing the same manually in PhpMyAdmin to wp_options under ‘home’ and ‘siteurl’ (Mind you this can be a fix if you’re using a different URL for your WP install than your server configuration, so that it bounces between http://www.yoursite and http://yoursite)
Note: You need check the debugger out. You can add wp-config.php
TIP: when things hit the fan, churn on that debugger and amaze at the amount of useful information it provides you!
Now the debugger gave me two pieces of info I could use:
- An error stating MySQL server has gone away followed by something about usermeta, meta_value and a gigantic string of information it apparently tried and failed to write into the database
- Several errors regarding Cannot modify header information – headers already sent
Because I suspected the errors came in in the right order, just like that, I finally discovered the problem: the database. It looked like a session token was being written into the database, but because it was gigantic, the database timed out, making WordPress fling me back to the login page again.
Here’s how to my fix it
According to the error message above (debug)
- Go into PhpMyAdmin to your WordPress database
- Find the table named as: wp_usermeta, wp_wpmailsmtp_tasks_meta,…
- Find and fix it.
A possible solution to that incessant and infuriating redirect loop problem that occurs when your database and WordPress stop playing together correctly. I’ve seen a lot of frustrated users in the forums with similar issues, so I hope this post will be of use to you.