How To Quickly Fix The “WordPress Keeps Logging Me Out” issue?

Are you repeatedly experiencing the “WordPress keeps logging me out” error message?

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? 

Don’t worry: we’ve been there and this WordPress logging you out issue can easily be fixed it!

There are multiple reasons why WordPress can keeps logging you out.

The following article will explore these various reasons and what steps should be taken to resolve the issues. 

WordPress logging out issue

Let’s fix this timeout issue and get you logged in to WordPress for good.

Fixing the “WordPress Keeps Logging Me Out” issue.

The WordPress login out problem is almost always a cookie issue. To get rid of it, clear your website and browser cache. Then verify your WordPress admin address (with www and without). Ultimately, deactivate your plugins one by one until the log-in issue is resolved.

Why My WordPress Keeps Logging Me 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 logging you out.

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

Most of the time, 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 address is entered in both fields. 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!

Frequently asked questions

How do I stay logged in to WordPress?
You can use the plugin “Inactive Logout” to achieve this. This plugin allows you to configure the login timeout.
How do I check my sessions on WordPress?
The easiest way to track sessions on WordPress is to install the plugin WP Activity Log. It provides detailed and real-time user activity reports, so you can know who is logged on your WordPress sites.
Where are WordPress sessions stored?
By default, WordPress sessions are stored in your file system according to your PHP settings. Your PHP.ini file should contain a session.save_path setting where all user sessions are stored.
How can I see who logged in on WordPress?
There is no built-in function for this in WordPress, but you can easily add it yourself if you don’t want to use the Plugin WP Activity Log. To keep track of each user’s last login time, you can use the wp_login hook. Afterward, you can see which users have logged in in the past 30 minutes or so. Then, you can echo out the users that logged in within the timeframe of your choice.
Does WordPress use cookies by default?
In WordPress, logged-in users and authentication are managed through cookies. Additionally, cookies are used to remember a user’s name and email address if they submit a comment.