preloader

Why User Switching Logs You Out Instead of Switching Accounts

You install User Switching to test accounts. You click “Switch to User.” You get logged out instead. You are now on login page. That is frustrating because you cannot test other accounts.

A common issue is that your caching plugin or security plugin blocks the switching cookie. User Switching sets a temporary cookie. If cookie is blocked, switching fails. The plugin is not broken. Another plugin is interfering.

Why User Switching Fails

User Switching works by setting a secure cookie that tells WordPress you are switching between accounts. When you click “Switch to User,” plugin sets cookie and redirects. If cookie is blocked (by cache, security, or browser settings), WordPress does not recognize the switch. You get logged out.

This is not User Switching being bad. Cookie blockers are the problem.

The Most Common Switching Failures

  • Security plugin blocks user switching cookies
  • Cache plugin serves cached login page
  • Browser blocks third-party cookies
  • Site uses Cloudflare with cookie-less domain
  • Session handler conflict with another plugin

Check these first.

How to Fix User Switching Logouts

  1. Temporarily disable security plugins (Wordfence, Sucuri, Cerber)
  2. Test user switching
  3. If works, whitelist user switching cookie in security plugin
  4. Disable cache for admin pages
  5. Clear all cache and test again
  6. Test in incognito browser window

Finding which plugin blocks cookie is the fix.

How to Whitelist User Switching in Wordfence

Go to Wordfence → All Options → Advanced Firewall → Whitelisted URLs. Add /wp-admin/ and /wp-login.php with parameters. Also add “wordpress_user_sw_” cookie to whitelist. Save. Test switching.

Contact security plugin support for exact cookie names.

Alternative: Use Different Browser for Testing

Instead of switching accounts, open incognito window. Log in as test user. Use another browser for admin. This avoids switching entirely. No plugin needed.

Manual method is slower but always works.

People Also Ask About User Switching Problems

Why does User Switching log me out instead of switching?

Cookie blocked by security or cache plugin. Whitelist the cookie.

Should I delete User Switching?

No. Fix cookie blocking. Or use manual method (incognito window).

Is User Switching worse than WP User Switch?

Both use same cookie method. Same issues. Whitelist the cookie.

Final Thoughts

If User Switching logs you out, check security and cache plugins. Whitelist user switching cookie. Test in incognito window. Your switching will work again.

Keep Reading

Previous Post Why Theme Check Says Your Theme Has Errors But It Works Fine Next Post Why Disable Comments Still Shows Comment Form on Some Pages

Need Help With Your WordPress Site?

If you need help with WordPress fixes, plugin issues, theme customization, or development work, feel free to get in touch.

Get a Free Estimate