How To Fix The “WordPress Keeps Logging Me Out” Problem
11 mins read

How To Fix The “WordPress Keeps Logging Me Out” Problem

How to fix the “WordPress keeps logging me out” problem depends on what’s causing it. If you’re having this issue, start with the simplest solutions and work your way up to more complex ones.

WordPress Keeps Logging Me Out

1. Clear Your Browser’s Cookies

One of the most common reasons for WordPress to repeatedly log someone out is when they’re trying to access their site with an expired cookie saved in their browser —which means their most recent browser session can’t be authenticated. Clearing your cookies should solve this issue if it’s the culprit for you.

Note: To make a quick test if caching or cookie settings are logging you out of WordPress, you could use incognito mode. Private browsing works by initiating a separate temporary session from the main one, allowing you to rule out session-related problems. This won’t fix the problem, but it can help troubleshoot possible issues!

Clearing cookies is straightforward in most major browsers. We’ll take you through how to clear your cookies in the four most popular web browsers: Chrome, Firefox, Safari, and Edge Browser.

Google Chrome

At the top right, click on the three vertical dots icon, then click Clear browsing data. A new tab will open with a popup box. Make sure you’re in the Basic tab.

Choose a time range to delete your cookies. To delete everything, choose All time.

Check the box next to Cookies and other site data.

Click Clear data.

WordPress Keeps Logging Me Out

Firefox

In the Menu bar at the top of the screen, click on Firefox and select Preferences.

Click Privacy & Security from the menu on the left-hand side. Then, go to the Cookies and Site Data section. Click the Clear Data… button, and the Clear Data cookie notification dialog box will pop up.

Both Cookies and Site Data and Cached Web Content will be checked by default, so un-check Cached Web Content if you only want to clear cookies. Then, click Clear.

Microsoft Edge

Go to Settings, then Privacy and Clear browsing data. Then, use the keyboard command Ctrl + Shift + Del. You can also go to edge://settings/clearbrowserdata in your browser to clear your browser cache.

2. Check Your Browser Settings

If clearing your browser cache and cookies didn’t stop WordPress from logging you out, then it’s time to look at your browser settings. A usual suspect is your browser cookie settings, which may be forcing cookies to expire and forget your login details,  prompting you to log back into WordPress constantly.

Luckily, this is another pretty easy fix. Below, we’ll show you how to access and check your browser settings in the four major browsers we’ve been using so far.

Chrome

Once again, click on the three vertical dots icon at the top right of your browser, then click Settings. Select Privacy and security in the lefthand menu and then on the right, select Site settings.

'Privacy and security' tab on the Google Chrome Settings window with 'Site settings' annotated.

Scroll down and click Third-party cookies under Content. From there, you can choose to:

  • Allow third-party cookies
  • Block third-party cookies in Incognito mode
  • Block third-party cookies

If cookies are blocked, that could be interfering with your WordPress session and logging you out. If this is the case, select Allow third-party cookies by clicking on the button next to it. And voila! Now your browser will save the cookie for your WordPress login session.

Chrome's 'Default behavior' dialog box with the 'Allow third-party cookies' option selected.

Firefox

In the Menu bar at the top of the screen, click on Firefox and select Preferences.

Choose Privacy from the options at the top of the popup box. This is where you can view your settings for Enhanced Tracking Protection, which includes cookies.

From here, you can choose:

  • Standard
  • Strict
  • Custom

If Strict or Custom is selected, some or all cookies may be blocked. Selecting Standard will revert Firefox to default cookie settings and allow all cookies.

Microsoft Edge

At the top right, click on the three horizontal dots icon. In the drop-down menu, click the gear icon for settings. From the settings menu, select Cookies and site permissions.

Click Manage and delete cookies and site data. From here, you have three options:

  1. Allow sites to save and read cookie data
  2. Block third-party cookies
  3. Preload pages for faster browsing and searching

Choose Allow sites to save and read cookie data to make sure your cookie settings aren’t causing the “WordPress keeps logging out” error.

3. Clear Your WordPress Site’s Cache

Now that we’ve covered browser-related causes, it’s time to explore other potential reasons WordPress keeps logging you out. If you have a WordPress caching plugin installed, it’s the next place to look. It’s possible that the plugin is storing an outdated version of your site, triggering the “WordPress logging out” issue.

Depending on which caching plugin you use, you’ll typically have an option (or a set of options) on your admin dashboard to clear your WordPress cache with just one click. Go to your dashboard and look at the admin bar at the top of the menu. It’ll likely say something like Delete Cache or Purge Cache.

Once you click the button or choose the option you want, WordPress will direct you to your caching plugin, where you can either select more options or confirm that you want to delete your cache. You may even be able to choose specific cache elements to delete. When you reload your WordPress site, it will automatically generate a new cache.

4. Check Your WordPress Site Address

Another reason why WordPress might keep logging you out is because there’s a mismatch between your WordPress site address and the URL saved in the login session cookies. Often, this happens after a domain name change or when you add an SSL certificate, usually because you might forget to update the website URLs in WP-Admin.

You can check this by going to Settings (in the menu on the left side menu on your admin dashboard) and clicking on General. You may need to scroll down a bit, but you should see two URL fields labeled:

  • WordPress Address (URL)
  • Site Address (URL)

WordPress Address is the location of your WordPress files, while Site Address is the address visitors need to type to find and access your website.

In the Site Address field, you can set the URL to either http://www.yourdomain.com or http://yourdomain.com. Some people prefer not to have “www” before their domain name for branding reasons or to make their URLs easier to type.

What you’re looking for here is if the two addresses in both these fields are mismatched. If that’s the case, WordPress may see the discrepancy and log you out by default. You may be able to just edit the URLs right there in your Settings, then click the Save Changes button at the bottom of the screen. However, if that doesn’t work or if you can’t stay logged in for long enough to update the URL settings, WordPress Keeps Logging Me Out you’ll have to fix this another way.

The best way to do this is to edit your wp-config.php file. This document contains vital information for your WordPress site, like its database connection details.

You can access this file using a Secure File Transfer Protocol (SFTP) client. One of the most popular options is the free FileZilla program. If you’re a customer, you can also use our secure WebFTP program.

Start your SFTP client and look for the wp-config.php file. You can find it in the root directory of your domain.

Open the file and paste the following code into it. You’ll want to swap out the example text for your own domain names:

define( ‘WP_HOME’, ‘http://example.com’ );
define( ‘WP_SITEURL’, ‘http://example.com’ );

Now save the file and close your SFTP client. After that, you can go back to your WordPress dashboard to check if the logging out issue was resolved.

5.Disable And Re-enable WordPress Plugins

Are you still with us? If none of the reasons we’ve covered so far seem to be causing your WordPress logging-out issue, the next troubleshooting step is to check for conflicts with plugins.

A plugin is an add-on that you have installed on your WordPress site. You may have sourced it from the Plugins section on your site or through the WordPress plugin directory.

A faulty plugin could be causing WordPress to log you out if it performs login authentication using cookies to function on your site. To see if this is your problem, you need to isolate and disable the faulty plugin.

Apart from the reasons we’ve mentioned so far, a faulty WordPress plugin could also be behind the “WordPress keeps logging me out” issue. This is particularly likely if that plugin performs login authentication using cookies. Poorly-coded plugins can also be the cause of login or logout issues. To see if this is the cause of your problem, you will need to pinpoint the faulty plugin first and then disable it.

If you only have a few active plugins, this will be an easy process. However, if you have many add-ons, buckle in — this is going to take a while!

You can deactivate plugins by clicking Plugins and then Installed Plugins on the left side menu on your WordPress admin dashboard.

You’ll need to reactivate each plugin one at a time and test to determine if it is the issue. You can do this by enabling one plugin, logging back into your WordPress dashboard, and checking to see if it triggers the problem. Clear your cache in between each plugin. When you start having login issues again, the last plugin you reactivated is most likely to blame.