If WordPress keeps logging you out, the authentication cookie is expiring, being rejected or no longer matching the website address. The issue may affect every user or only one browser, device or account.
Clear the site’s cookies
Delete cookies for the domain, close the browser and sign in again. Test a private window and another browser. Also confirm that the device date and time are correct because inaccurate time can invalidate authentication cookies.
Make the WordPress URLs match
Go to Settings > General and compare the WordPress Address and Site Address. They should normally use the same HTTPS protocol and the same www or non-www hostname.
If access is unstable, define both values temporarily in wp-config.php:
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );
Use the exact canonical address. A domain mismatch causes WordPress to set a cookie for one hostname and redirect the browser to another.
Clear WordPress, server and CDN caches
Purge every caching layer. Make sure authenticated sessions, wp-admin and the login screen are excluded from page caching. Some CDN and cache configurations mistakenly serve logged-out pages to authenticated users.
Check cookie and domain constants
Review wp-config.php for custom values such as COOKIE_DOMAIN, ADMIN_COOKIE_PATH or COOKIEPATH. Old constants from a migration or multisite configuration can break sessions. Remove unnecessary overrides after creating a backup.
Disable the most likely plugin
Security, membership, single sign-on, activity timeout and caching plugins can alter authentication behavior. Deactivate the plugin changed most recently, clear cookies and retest. On staging, disable plugins one at a time when the cause is unclear.
Check HTTPS and reverse proxy settings
A CDN or load balancer may handle HTTPS while sending HTTP traffic to the origin. WordPress must receive the correct forwarded protocol information. Otherwise, secure cookies and redirects may become inconsistent.
Confirm the CDN SSL mode matches the origin certificate and remove duplicate HTTP-to-HTTPS redirects.
Refresh WordPress authentication salts
Replacing the authentication keys and salts in wp-config.php invalidates every active session and can resolve corrupted or compromised cookies. This forces all users to log in again, so schedule the change appropriately.
Review session expiration settings
WordPress normally maintains longer sessions when “Remember Me” is selected. Plugins or custom code may shorten the authentication cookie duration. Search custom snippets and security settings for session timeout filters.
Do not make administrator sessions excessively long on shared or public devices. Convenience should not override account security.
Check the affected user account
If only one user is logged out repeatedly, reset that user’s password and revoke existing sessions from the profile screen. Confirm the role and user metadata are intact. Repeated unexpected session loss can also justify a malware and account-security review.
Differentiate logout problems from login loops
A logout problem occurs after you successfully reach wp-admin. A login redirect loop immediately sends you back to the login page. Use my guide to fix the WordPress login redirect loop when you never reach the dashboard.
Prevent repeated WordPress logouts
- Use one canonical HTTPS domain.
- Exclude authenticated traffic from page caching.
- Remove outdated cookie constants after migrations.
- Keep login and security plugins updated.
- Review administrator accounts and sessions regularly.
For broader performance and access problems, see the WordPress troubleshooting hub.
