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:


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.

12 Answers 12


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.

  • 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

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

  • 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

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.


"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.)


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.


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'


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 :)


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.


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);

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


If your wordpress is behind a proxy, causing infinite redirects to https, you may need to tell wordpress that https is actually on:

// wp-config.php

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) {
    $_SERVER['HTTPS'] = 'on';


In my case what happens is that my database is so large (big site...) that when I use a staging site and basically, duplicate my database I run out of database storage. It therefore can't write to it anymore. In my case I not only had to remove the stating site, but also had to fix the database (in cPanel there is an option).

  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Mar 11 at 18:38

Your Answer

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

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