Redirect loop in wp-login with reauth = 1 (solutions)

There is a very ugly error that can sometimes arise in a WordPress site whereby, when accessing the administration of your website, it returns you to the front page and there is no way to access it . Your site is visible but you cannot manage it, or add new content or anything, you cannot enter the WordPress administration.

infinite loop wordpress

A sneak peek at this is usually a URL like this:

http://misitio.es/wp-login.php?redirect_to=http%3A%2F%2Fmisitio.es%2Fwp-admin%2F&reauth=1

There may be several culprits, namely:

  • A recent domain / server migration.
  • After a multisite WordPress activation.
  • After a deactivation of WordPress multisite.
  • A failed WordPress update.
  • Plugins.
  • Theme.
  • Cookies that do not expire.
  • Persistent cache.
  • A corruption of database tables for any of the above or other reasons.

And if it is already difficult to find the problem, do not think that finding the solution is easier. However, there are quite a few ways to try to solve it so let’s see them and try to find yours. You don’t have to do everything, just try one by one until you find which one solves the problem, okay? …

  1. Before starting add the line
     define ('WP_DEBUG', true);

    to the wp-config.php file to see the errors that are generated and can give you clues.

  2. Empty your browser’s cache , exit and start it again. Try to enter now.
  3. Use another browser that you do not usually use and try to enter. If you get it, empty the cache of your usual browser.
  4. Open an incognito session from your browser, or use Tor’s , to avoid problems with cookies.
  5. Clear your browser cookies and try to enter again.
  6. Reinstall WordPress manually via FTP or cPanel, replacing all files and folders from the previous WordPress installation with the new one, except the / wp-content / folder. Try to enter now.
  7. Force the disconnection of your site by typing the URL (replace yoursite.es with your clear domain), empty the browser cache, close it, open it again and try to enter again.
  8. Rename the folder / plugins / by FTP or cPanel to, for example / plugins-off / and try to enter. This action disables all plugins. Try to enter. If you succeed, rename the folder to its original name and activate the plugins one by one until you find the culprit.
  9. Rename the active theme folder from FTP or cPanel to force WordPress to activate the default theme (twenty-whatever). Of course you should have some twentysomething installed, if not you upload it manually first. Try to enter now.
  10. Disable the server cache if you have any active, empty the browser cache and try to enter again.
  11. Delete the .htaccess file and try to enter the administration. If you succeed, change the URLs of the site and WordPress in Settings -> General from www to without www or vice versa, another possible culprit for the error. Then go to Settings -> Permalinks and save changes without touching any settings so that the .htaccess file is re-created.
  12. An alternative to the previous trick is to manually define the URLs to use, force them, adding the following lines to your wp-config.php file:
    define('WP_HOME','http://tusitio.es');
    define('WP_SITEURL','http://tusitio.es');

    or …

    define('WP_HOME','http://www.tusitio.es');
    define('WP_SITEURL','http://www.tusitio.es');
  13. If you recently disabled Multisite, go to your wp-config.php file and add the following line to enable it:
    define( 'WP_ALLOW_MULTISITE', true );

    Try to enter now. If you succeed, install and activate this plugin and then set all its settings to the default values to erase possible bad previous configurations.

  14. Check the permissions of the wp-admin , wp-includes and wp-content folders to verify that they are 755 and if not, change them. Try to enter.
  15. Deactivate the CDN , if you have any service of this type active and try to enter.
  16. Open your wp-config.php file and change the unique authentication keys (the salt cookies ) by obtaining new ones from https://api.wordpress.org/secret-key/1.1/salt /. Save the changes and log back in.
  17. It could also be a problem similar to the infinite redirect of WordPress Multisite so add the following to the wp-config.php file, save the changes and try to enter again.
    define('ADMIN_COOKIE_PATH', '/');
    define('COOKIE_DOMAIN', '');
    define('COOKIEPATH', '');
    define('SITECOOKIEPATH', '');
  18. Check your utility plugin and the active theme’s functions.php file to verify that no custom redirects are active. If you find it, delete or comment on the lines that activate it.
  19. Review the .htaccess file and check if a security plugin has added a line that generates a redirect after accessing the administration and delete or comment it. When in doubt rename or delete the .htaccess file (remember to save a backup copy first) and try again.
  20. If you have recently activated the HTTPS version of your site, review each change made to achieve it and revert it to the default values (lines of code in .htaccess or wp-config.php , change of site and WordPress URLs, etc.)
  21. Access your database using phpMyAdmin from your hosting panel and locate the wp_options table (or loquesea_options) and checks URLs WordPress site and have the correct values.
  22. In PHPMyAdmin check that the table sizes are correct . When in doubt, select the main WordPress tables, optimize and repair them .
  23. From PHPMyAdmin locates the wp_usermeta table (or loquesea_usermeta if, happily, do not use the prefix wp_). Now find the rows with the title of session_token and delete all the values they contain.
  24. … And if you don’t get it with any of the previous tricks, you have no choice; Restore a backup of your site, including the database, from the day before the redirect failure began, which brings us down the path of bitterness.

It is a bloody error that, fortunately, is not very common but when it arises it is quite annoying until you find what is causing it.

It has happened to me several times on client sites and I have (almost) always solved it with one of the tricks exposed here. And if not, there is always to resort to the blessed backup copies .

If you know any other way to solve it that I have missed, it takes time to tell in the comments , more than one will thank you.

( 15 votes, average: 4.9 ) Rate this article to help improve the quality of the blog
Share on Twitter Share on Facebook Share on Pocket Share on LinkedIn Share on WhatsApp Share on Telegram

Did you like this article? You can’t imagine what you’re missing on YouTube !

NOTICE : This post is 3 years old or older. If it is a code or a plugin it might not work in the latest versions of WordPress, and if it is news it could be already out of date. Then do not say that we have not warned you. Ah! It works for you? Well then I have not said anything 🙂

About Us

We are BE OF THEM, a team specialized in the field of digital marketing and programming, our headquarters is in Germany, and our activity has expanded to reach all parts of the Middle East, especially the Arab Gulf countries.

Do you need to raise your site's score?

We have the perfect solution for marketing your business

Contact Us

Call us, or message us by email & whatsapp

We will be happy to talk to you, and knowing everything about your work.

All rights reserved, © 2021