8

There was a similar post to this, however the solution did not work for me.

I am having some difficulty logging into my WordPress site. When I attempt to visit example.com/wp-admin, I see the login page as per usual, however, once I enter my login details, the page essentially reloads and the url changes to:

http://example.com/wp-login.php?redirect_to=http%3A%2F%2Fmysite.com%2Fwp-admin%2F&reauth=1

This is a loop which I cant pass beyond. The front end of the website seems to be working as per usual. Visiting example.com/wp-login.php and entering my login details has the same behaviour as listed above.

I have confirmed this is not a problem with anything on my local machine as the behaviour persists across multiple browsers, devices and networks.

As suggested by others, I went into PhpMyAdmin > wp_usermeta > and deleted the meta_value for session_token. This did not fix the issue.

I turned on DEBUG and was provided with the following items when loading example.com/wp-login.php:

Warning: Cannot modify header information - headers already sent by (output started at /home//public_html/wp-includes/wp-db.php:1308) in /home//public_html/wp-login.php on line 425

Warning: Cannot modify header information - headers already sent by (output started at /home//public_html/wp-includes/wp-db.php:1308) in /home//public_html/wp-login.php on line 438

I have found numerous forum posts about the issue but none offer a satisfactory solution.

Please help as I urgently need to update content on the site.

10 Answers 10

3

For me, the solution to this WordPress Login loop problem was in the database.So step one is to login to the database. I just used PhpMyAdmin for this.Once logged, find your WordPress table, and navigate to the wp_options table.

There are two fields in this table that could be the culprit to your WordPress Login page looping problem.

  1. option_name: siteurl
  2. option_name: home

Ensure that the URL given in both of these two fields is set to what you expect it to be.(same URL) Change the value and you should be all set to go.

2
  • Thank you, thank you!
    – dinkelk
    Jun 15, 2020 at 23:14
  • I had this too - I needed to change the options to https instead of http in my table. Sep 24, 2020 at 8:27
3

My solution was add more disk space to my server. It causes wordpress to redirect at the login.

2
  • Same solution here - partition/drive was close to full - moved some old/unused files to a separate partition and was fine afterward.
    – John
    Nov 20, 2020 at 19:01
  • Yep, same here, all I tried didn't work until I activated the logging of errors and WP told me it could not create the log file because of lacking disk space Nov 27, 2021 at 10:35
1

"Headers already sent" errors are frequently caused by plugin conflicts. Since you have access to phpMyAdmin, you could try emptying the active_plugins data from the options table. (But first I would copy and save the option_value elsewhere for resetting it if it doesn't help.)

1

I had similar problem with getting into admin area of a wordpress site. My problem was solved by downgrading PHP version on my webserver from 7 to 5. Some plugins could not work properly under PHP 7. So after downgrading I deactivated all of them and upgraded PHP to 7 and it was working.

1

For me, the redirect loop started when I switched to HTTPS from HTTP. The solution was to add this line to the wp-config.php file:

$_SERVER["HTTPS"] = "on";

WordPress depends on a variable, $_SERVER[“HTTPS”] to check if it is on SSL. As a consequence, when this variable is not set and SSL is forced, WordPress tries to redirect back to http. This causes the redirect loop.

0

I had the same problem. In my case the mysql database wasn't renewed and it wouldn't be possible to write in it.

I discovered it watching at the log error of the server, where I found lots of errors like: WordPress database error INSERT,UPDATE command denied to user '<MYUSER>'@'<MYDBHOST>' for table '<MYPREFIX>_options'

0

My solution was similaro to @Marco Panichi's - I didn't realise my database went over the size limit. Fixed this is the hosting panel and the problem was gone. Ironically, the size limit e-mail from my hosting company went to spam :)

0

Check file permissions on wp-login.php and/or /wp-admin

I went through all the suggestions made in various articles and threads, but made no progress.

Inspecting the server log, I saw hints about file permissions during my attempts to login to WordPress. So in FTP, I inspected permissions on various key files.

The folder /wp-admin had permissions set to 775, and simply changing it to the more secure 755 fixed my login issue.

How did the original permissions come to be, I can only guess I did something custom months ago during local development, and forgot to revert the change. In any case, this is a reminder to scrub through and do a permissions/security assessment on the whole WordPress installation.

0

This can sometimes be caused by wp-super-cache plugin....in combination with really-simple-SSL plugin.

Solution: in wp-config.php change:

define('WP_CACHE', true);* to *define('WP_CACHE', false);
0

It's funny because seems anyone resolved with a different solution.

Mine is this: practically seems the login HAPPENS BUT WP keeps to redirect you to the login page. Crazy...

So I tried this: https://wordpress.org/support/topic/login-loop-on-aruba-softaculous/#post-11211949

In my case:

1) I browsed to https://my-url/wp-admin 2) WordPress redirected me to the login page with a long redirected URL. I inserted my login details 3) WP redirected me AGAIN in the login page 4) I DELETED the part of URL after wp-login in address bar and loaded the so shortened URL 5) Magically WP brought me in the admin dashboard...

See if helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.