A laptop login screen, browser settings panel, and cookie-shaped tokens on a desk.

WordPress Keeps Logging You Out? Find the Cause

Stale or blocked authentication data is a common cause of login problems. Clear cookies for the affected site first, while preserving other saved browser cookies, then investigate URL settings, caching and plugin conflicts if the problem continues.

Repeated logouts can interrupt publishing and client work, but changing several settings together makes diagnosis harder. Start with reversible checks and make one change at a time, testing the same action after each change.

Key takeaways

  • A successful login in another browser points towards local cookies, cached data or browser extensions.
  • Incorrect URLs, cached authentication pages and security plugins can invalidate an otherwise healthy login session.
  • Back up files and the database before configuration changes. Use staging for disruptive plugin or theme tests, and restore changes that don’t help.

1. Start with browser cookies and cache

Try a clean session first

Save any unfinished work, then open a private or incognito window and sign in. Also try another browser or device.

If that works, remove the affected site’s cookies in your original browser, then clear the browser cache. Site-specific removal avoids signing you out of unrelated services.

WordPress’s login troubleshooting guidance starts with cookies and browser cache. However, private browsing can apply stricter privacy rules, so a failed private-window test doesn’t prove the server is responsible.

An editorial illustration showing a bitten cookie and a browser window with a shield icon.

Review the browser’s cookie controls

Use these browser settings to check the main browsers.

BrowserWhat to change or clear
ChromeOpen Settings > Privacy and security > Clear Browsing Data. Select All time, Cookies and other site data, and Cached images and files (the browser cache). Leave passwords unticked.
FirefoxUnder Settings > Privacy & Security, test Enhanced Tracking Protection on Standard rather than Strict or a restrictive Custom setting. Remove the site’s stored cookies.
SafariUnder Settings > Privacy, leave Block all cookies off where available. Use Manage Website Data to remove the affected site.
EdgeIn Settings, search for Cookies. Allow sites to save and read cookie data, and inspect site-specific exceptions.

Chrome’s older menu wording was More Tools > Clear Browsing Data. Browser settings and control labels can vary by browser or version. Likewise, Safari instructions mentioning “Always allow” refer to older versions.

Third-party cookies can affect external single sign-on, but ordinary WordPress login normally uses first-party cookies. Avoid disabling protections globally in your cookie settings. On mobile, use the browser’s site-data controls and repeat the same login test.

2. Correct unintended WordPress URL differences

Compare both dashboard addresses

Open Settings > General and record WordPress Address (URL) and Site Address (URL).

For a standard installation, compare the public site address with both settings. They should match, including https, hostname and any www prefix. An unintended URL mismatch can disrupt authentication, and domain migrations or SSL changes often leave an old value behind.

WordPress can deliberately live in a subdirectory whilst the public website uses the domain root. Preserve that arrangement. WordPress’s General Settings documentation explains the two addresses.

After correcting an unintended difference, remove the site’s browser cookies and sign in through the intended site address.

Regain access through configuration

If you can’t save those fields or reach the dashboard, use SFTP to download a backup of wp-config.php and upload the corrected file, or use your hosting File Manager.

Above its stop-editing comment, a standard root installation can use define('WP_HOME', 'https://example.com'); and define('WP_SITEURL', 'https://example.com');. Replace the example domain with your actual address and omit trailing slashes. Preserve any deliberate installation subdirectory.

Edit existing definitions rather than duplicating them. These constants override database values immediately and make the dashboard fields read-only; they don’t update the underlying database records.

Also inspect a custom COOKIE_DOMAIN. An obsolete hostname can break authentication. Remove an unnecessary override on an ordinary single-site installation rather than adding a leading dot blindly.

Restore the saved configuration file if access worsens.

3. Purge WordPress, hosting and CDN caches

To clear cache in the right order, purge the caching plugin first, then the host’s page cache, then any CDN cache. Disabling a caching plugin doesn’t remove copies held elsewhere.

With W3 Total Cache, start with Performance > Purge All Caches. Host and CDN caches may need separate purges, even when a plugin connects to them.

A 3D papercraft network diagram showing data flowing through a cache, cloud, and server.

Exclude /wp-login.php, /wp-admin/ and authenticated traffic from page caching. Never apply a broad “cache everything” rule to administration pages.

Then sign in, open several dashboard screens and repeat the action that caused the logout. If the fault disappears only whilst a cache layer is bypassed, investigate its exclusions before re-enabling it.

Object caching differs from page caching. Don’t flush a busy site’s persistent object cache repeatedly without a reason.

4. Isolate security plugins, other plugins and themes

Disable plugins without deleting their data

First inspect security-plugin settings for idle timeouts, session timeout settings, concurrent-session limits or forced logouts. Record any custom login address before disabling a login-hiding plugin.

Use staging where possible. Disconnect email marketing and lead-generation automations there so tests don’t contact real clients.

Without dashboard access:

  1. Record active plugins, then rename wp-content/plugins to plugins.hold using SFTP or File Manager.
  2. Retry login and visit /wp-admin/plugins.php whilst the folder remains renamed, so WordPress recognises the missing plugins as inactive.
  3. Restore the folder name to plugins.
  4. Reactivate plugins individually, clearing relevant caches and repeating the failing action after each activation. This can identify a plugin conflict.

Start with parent plugins before dependent add-ons. Don’t uninstall anything. Must-use plugins and hosting drop-ins remain active during this test.

If nothing changes, restore the original plugin state.

Test the theme and custom login code

On staging, switch to an installed, compatible default theme such as Twenty Twenty-Five.

If access becomes stable, inspect the original theme, child theme and recent custom web development changes. Look in functions.php for leftover calls such as wp_clear_auth_cookie() or wp_logout() added during an earlier login fix.

Restore known-good code before clearing cookies and retesting. Don’t remove unfamiliar code speculatively.

Theme switching can alter web design, navigation and digital branding, so avoid casual live-site changes.

5. Separate normal cookie expiry from server faults

Measure how long the session lasts

Record when the login session starts, whether Remember Me was selected, and when the logout occurs. Note whether it follows inactivity, a browser restart or a particular action.

By default, Remember Me gives WordPress authentication cookies a 14-day lifetime. Without it, authentication expires after two days, although closing the browser can end the browser session sooner.

A developer can extend cookie expiration for remembered sessions through auth_cookie_expiration. For example, in a tested site-specific plugin: add_filter('auth_cookie_expiration', function ($seconds, $user_id, $remember) { return $remember ? 21 * DAY_IN_SECONDS : $seconds; }, 10, 3);.

WordPress also provides WEEK_IN_SECONDS, MONTH_IN_SECONDS and YEAR_IN_SECONDS.

Longer sessions increase exposure on shared or unattended devices. Use individual accounts and two-factor authentication. Extending expiry won’t fix rejected cookies.

Escalate persistent failures with evidence

WordPress core authentication uses cookies and stored session tokens, not ordinary PHP sessions. Randomly increasing PHP session settings usually won’t help.

Give your hosting provider failure timestamps, affected URLs and test results. Ask them to investigate HTTPS detection behind proxies, server clocks, cookie headers, shared session-token storage and inconsistent authentication keys across application servers.

Rotating authentication keys invalidates everyone’s existing login cookies, so coordinate that change.

If access is unstable or unfamiliar redirects appear, run an external malware scanner that doesn’t require wp-admin, followed by a server-side scan. Public scans can’t inspect every infected file.

Our managed and shared hosting comparison explains how technical responsibilities differ.

6. Prevent repeated login failures

Keep WordPress, plugins and themes supported, but test updates with a recoverable backup. Record URL changes, cache exclusions and custom authentication code.

Choose one primary page-cache system and document its relationship with hosting and CDN caches. Also assign responsibility for deployments and cache purges.

After repairs, test dashboard access and logged-out visitor journeys. Submit a labelled test enquiry, inspect its notification and test the mobile-responsive layout. Stable administration doesn’t prove lead generation or conversion tracking still works.

For a small business, routine website care and support should cover controlled updates, security monitoring and recovery.

Keep SFTP and client-site credentials separate, and store both securely. Treat staging as a separate environment, particularly where systems and automation can trigger customer messages.

Frequently asked questions

What is the WordPress logout URL?

The standard path is /wp-login.php?action=logout. Opening it directly may display a confirmation screen because the request lacks a valid security nonce.

Developers should use wp_logout_url() to generate the appropriate nonce-protected link rather than hard-coding a logout address.

How can I inspect redirects after login?

Open browser developer tools, select Network and enable Preserve log. Sign in, then inspect redirects and their Location headers.

An unexpected switch between HTTP and HTTPS, www and non-www, or old and new domains points towards URL or proxy configuration. Our WordPress redirect-loop guide covers repeated redirects.

Why doesn’t Remember Me stop the logouts?

Remember Me changes cookie duration. It can’t override browser cookie deletion, security-plugin timeouts, password changes, invalidated sessions or incorrect cookie scope.

If logout happens immediately, investigate those causes before extending the expiry period.

Restore stable access before changing session limits

When WordPress keeps logging you out, check for a cookie, URL, cache or authentication fault before considering longer cookie lifetimes. Longer cookie lifetimes should follow a deliberate security decision, not substitute for diagnosis.

Keep the change that fixes the fault and reverse unsuccessful experiments. For ongoing technical support with client websites, See how we collaborate with creative agencies.

Leave a Reply

Your email address will not be published. Required fields are marked *