Can't login to admin dashboard because of "Warning: Cannot modify header information...&am

Yesterday, I discovered I was unable to login to the admin dashboard of my MU site (or to the dashboard of any of the subsites) because of this error: Warning: Cannot modify header information - headers already sent by (output started at /home/mywinterthur/ in /home/mywinterthur/ on line 1179

No themes or plugins have been installed since last successfully logging in for weeks. Nor have any PHP files been edited in a very long time. Essentially, saying there's no obvious connection between any admin work and this error.

Most of my sites went through an automated update within the last couple days, including this one, I believe, though to be sure, I'd have to go find the email stating that. This is my first attempt at logging into the MU admin since getting that flurry of emails.

Since I am unable to get into the admin dashboard, the vast majority of "fixes" that I've found online are not applicable since the first thing they say is to login to the dashboard. A small sample of the others call for reinstalling Wordpress or other fairly extreme measures that don't sound particularly applicable to fixing this issue.

Digging into pluggable.php, the error seems to be occurring in the wp_redirect function when it actually tries to do a redirect: header("Location: $location", true, $status).

I have read WPMU's article, "Fixing the “Cannot Modify Header” Error in WordPress" but the remedies suggested in there, I don't think it apply in this case.

I am hoping you have seen something similar and have a suggestion on how to proceed.

Thank you,
Alan Harbaugh

  • aharbaugh
    • WPMU DEV Initiate

    Update: I decided to try to login to all of the subsites and finally found one that I could login into. And from there I was able to bump up to the Network Dashboard. But I still can't login to the other subsites because of the error message mentioned above. But I can at least get to the admin functions now. Hopefully you have some advise and I can get you access now, if need be.

  • aharbaugh
    • WPMU DEV Initiate

    Update: So following the error message, it points to wp-login.php as the source of the error. The specified line is: <html xmlns="" class="ie8" <?php language_attributes(); ?>>

    The file is dated 11/20/2016 and logins have been fine since that time AND I can login to at least one subsite, so it doesn't seem like wp-login.php IS the actual problem.

  • Martin
    • Flash Drive

    Does "automated update" mean only WordPress core or plugins/themes as well? Can you replicate this error (copy files + db to another host, do you get the same error)?

    To elaborate on the error message: The wp-login.php page sends the first HTML text and then some code tries to execute wp_redirect() - which of course fails for the given reason.

    • aharbaugh
      • WPMU DEV Initiate

      Thanks for the input Martin.

      I've figured out the issue.
      I use a password manager and the admin account is used across some, but not all, of my subsites.
      So when the password changed, the password manager only changed it for a specific domain.

      The error was occurring when the invalid login was being redirected but ALSO being told to 'shake' the login box. But since the error page came up, I couldn't see the issue was an invalid login.

      Thanks and apologies for wasting anyone's time on this.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.