Title: Cannot modify header information when switching users
Last modified: February 2, 2019

---

# Cannot modify header information when switching users

 *  Resolved [krko](https://wordpress.org/support/users/krko/)
 * (@krko)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-when-switching-users/)
 * Hey guys,
 * Until recently had no trouble at all using the plugin but recently when switching
   I get this error:
 * Warning: Invalid argument supplied for foreach() in /path-to/wp-admin/includes/
   plugin.php on line 1554
 * Warning: Cannot modify header information – headers already sent by (output started
   at /path-to/wp-admin/includes/plugin.php:1554) in /path-to/wp-includes/pluggable.
   php on line 1219
 * Line 1554 in plugin.php is: foreach ( $submenu[$parent] as $submenu_array ) {
   
   Line 1219 in pluggable.php is: header(“Location: $location”, true, $status);
 * I’d appreciate your help.
 * krko

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [krko](https://wordpress.org/support/users/krko/)
 * (@krko)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-when-switching-users/#post-11159953)
 * Just to add some more information, the user is actually switched, so if I go 
   manually to url/my-account/ I’m in the new user account and the switch back link
   works fine.
 * krko
 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [7 years, 4 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-when-switching-users/#post-11160302)
 * It sounds like another plugin or the theme on your site is triggering output 
   when it shouldn’t. Can you try deactivating your other plugins one by one to 
   try to identify the culprit?
 *  Thread Starter [krko](https://wordpress.org/support/users/krko/)
 * (@krko)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-when-switching-users/#post-11163709)
 * Thanks, I’ll have to create a staging for that one. It’s gonna be a loooong day
   🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cannot modify header information when switching users’ is closed to new
replies.

 * ![](https://ps.w.org/user-switching/assets/icon.svg?rev=3193956)
 * [User Switching](https://wordpress.org/plugins/user-switching/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-switching/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-switching/)
 * [Active Topics](https://wordpress.org/support/plugin/user-switching/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-switching/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-switching/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [krko](https://wordpress.org/support/users/krko/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-when-switching-users/#post-11163709)
 * Status: resolved