How to Fix WordPress Keeps Logging Out Problem

WordPress logging out issue

If you are experiencing the “WordPress keeps logging me out” error message repeatedly, then you have come to the right place.

When you try to use your Admin Dashboard, your site suddenly locks you out? Your site becomes inaccessible leaving you in the dark about why it keeps happening and unable to make changes to it? Don’t worry: we’ve been there, and fixed it!

There are multiple reasons why WordPress keeps logging out. The following article will explore these various reasons and what steps should be taken to resolve the issues. 

Let’s troubleshoot this WordPress session timeout problem!

Why WordPress Keeps Logging You Out?

It is important to understand how WordPress works in order to understand why you keep getting logged out.

In order to authenticate a login session, WordPress sets a cookie in your browser. This cookie is set for the WordPress URL stored in your settings section. 

This means that a discrepancy between the URL set in this cookie and the URL with which you access your site will block WordPress from authenticating your session and log you out.

Anything that my corrupt the interaction between this cookie and your WordPress website might cause the error.

Most of the times, you’ll see the message “Session expired”.

Bottom line: the WordPress login out problem is almost always a cookie issue.

Fixing The “WordPress Keeps Logging Me Out” Issue

Step 1: Troubleshoot Browser Issues

Your browser might be causing the WordPress logout problem. An expired cookie could be trying to authenticate your session through a cached version of the page within your browser.

If this is the case, clearing your browser’s cache will fix the issue

The issue could also come from the cookie that was already installed in your web browser for the website. In this situation, an expired cookie might override the most recent one, causing an error.

If clearing your browser’s cache didn’t work, try to delete the cookie linked to your website.

If none of this is working, your browser’s cookie settings may be causing the problem. You may need to adjust them if they force your cookies to expire or refuse any kind of cookies.

If you don’t know how to clear cache, cookies and update your browser’s settings, check out this ‘how to guide‘.

Step 2: Clear your WordPress site’s cache

If you’ve reached this point and still have a problem, the issue’s not your browser’s fault. The “WordPress keeps logging me out” issue could thus be caused by your WordPress site’s cache.

WordPress caches files and database queries to save time and server resources. It thus affects the load time of your site and the user experience in a positive way.

Changes to webpage content can be overlooked by the caching system. This can lead to outdated content or cause you to constantly log out. 

Site caches can be cleared in a few clicks, but the process can differ based on your host as well as if you are using caching plugins.

Clear WP Rocket Cache

Go to Settings → WP Rocket → Dashboard tab and press the Clear cache button.

clearing wp rocket cache in WordPress

You may also do this through the WordPress toolbar. Click on WP Rocket’s menu link, and you will see a dropdown menu. Clear your browser’s cache by clicking the link.

clearing wp rocket cache

Clear Cache in W3 Total Cache

Head over to Performance » Dashboard page and click on ’empty all caches button.

clearing W3 total cache

If you are using another caching plugin check its documentation.

Step 3: Check Your WordPress Site Address To Fix The Login Issue

It can also be fixed by making sure that your Site Address and WordPress Address fields are the same.

Therefore, you must choose either a www URL or a non-www URL in both fields.

troubleshooting login issue in WordPress

Log on to your WordPress dashboard and click Settings » General. Make sure that the same adresse is entered in both field. Pay attention to the www.

If you can’t access the admin area, then you can edit these fields using the wp-config.php file.

Use an FTP client to connect to your website, then download the wp-config.php file to your desktop.

Open the file with your HTML editor and add this code just above the line That’s all, stop editing! Happy blogging.

define('WP_HOME','http://mysite.com');
define('WP_SITEURL','http://mysite.com');

Make sure to substitute mysite.com with your own domain name.

Step 4: Disable WordPress Plugins

If nothing has worked so far, there may be a conflict with one of the plugins you’re using.

Whenever a plugin authenticates the session with a cookie, and the cookie isn’t properly set up or there is an issue with it, it can cause the WordPress login timeout error.

You have to disable your plugins manually to troubleshoot this probable cause.

Step 1: Use your FTP client to go to /wp-content and rename the plugins folder. Choose a clear name to avoid confusion in the future.

Step 2: Try refreshing your site and see if the issue has been resolved. If the fix worked, then restore the plugin folder’s original name. Refresh the page in your browser.

Step 3: Activate each plugin one-by-one until the error disappears. Then delete this plugin and contact its support.

Conclusion And Wrap Up

Thankfully, in most cases, the WordPress session timeout problem that leads to the “WordPress keeps logging me out” error can be resolved with relative ease. Make sure to:

  1. Clear Your Browser’s Cache & Cookies
  2. Fix Your Browser’s Settings
  3. Clear Your WordPress Site’s Cache
  4. Check Your WordPress Site Address
  5. Disable and Re-Enable WordPress Plugins

Logging into and using WordPress should now be a piece of cake!

Test the performance of your website for free

Copyright © 2020 - 2021 - WP Umbrella