WordPress may be the most popular CMS on the market by a mile, but it still has its fair share of common errors you will run into. One of these is the problem with WordPress logging you out suddenly, which can be quite annoying.
The good news is that most errors in WordPress have a lot of resources to fix them. And in most cases, they are simple fixes. This issue is no different and can be resolved by following a few simple steps.
The only problem here is that a lot of things can cause this error. As a result, troubleshooting the issue can be downright frustrating if it is your first time. But don’t worry, this guide will show you everything you need to know.
Today, I will cover multiple methods that will resolve the “WordPress Keeps Logging Me Out” issue.
What Is the “WordPress Keeps Logging Me Out” Issue?
Unlike most of the common WordPress errors you will encounter, when WordPress keeps logging out, it doesn’t produce an error message. Instead, your account is constantly logged out of WordPress after a random amount of time has passed.
As you can imagine, or have experienced yourself, this is incredibly annoying and inconvenient to deal with.
For example, imagine you are working on a new blog post, and every time you log in and begin typing, you are logged out. The worst part, the website gives you no indication of why you have been logged out or how to fix it.
It’s frustrating and can easily interfere with your ability to manage a website. So, the next question is, what can cause it?
Well, a lot of things. The primary cause of such an error is usually your web browser. This can be the cache or cookies you have stored within or even the settings.
Luckily, these are all really easy things to fix, but problems could also be on your WordPress site itself. It could have to do with the site address not matching within WordPress, or it could be the result of a plugin.
With that said, I will cover the most common causes of the issue with WordPress logging you out, so it should work for most websites.
Fix the WordPress Keeps Logging Me Out Error
Before you begin troubleshooting this error, it is important to make sure you have a backup in place. While we will not be doing anything difficult, it is a good rule of thumb to always create a backup before troubleshooting a problem.
Failing to do so can leave you worse off if you create a new problem while trying to fix an existing one. Luckily, there are a lot of great backup plugins you can use to accomplish this, and many of them are even free to use.
With that said, let’s start with the easiest fixes using your web browser.
Note: To save time, try opening up a different web browser (Google Chrome, Firefox, Safari, etc.) and see if the issue persists. If it does, then the web browser is not the problem (skip to method 4), but if it is, the first three methods are likely the solution.
Method 1: Clear Your Web Browser’s Cookies
The first main cause of this error is an expired cookie your web browser is storing. This works because the session you logged into is trying to authenticate itself, but it is using expired cookie data.
As a result, the authentication fails, which ends the session you are in. Or in other words, you get logged out of WordPress. You can directly locate and delete that expired cookie or clear the cookies all at once.
Let’s focus on clearing all of the cookies as that is the easiest way to fix it.
Note: This method depends on your web browser. In the below example, I am demonstrating the process using Google Chrome. Thus, if you are using a different browser, the process will be different. Please refer to that browser’s documentation for more assistance.
On the top right of your Chrome browser, click on the three vertical dots. Hover over History and click on the History option that appears. Alternatively, use the keyboard shortcut CTRL+ H.
Once there, you will see a full list of your website’s browsing history. More importantly, on the left-hand side, click on the Clear Browsing Data option.
This will open up a new tab and a pop-up window. Check the box to clear the Cookies and other site data. Then click on the “Clear data” button.
Once the process is finished, go back to your website and try logging in. If you stay logged in without issue, congratulations, the error has been fixed. To avoid this in the future, check out method 3 to change the browser settings.
If not, let’s try removing the browser cache next.
Method 2: Clear the Browser Cache
While expired cookies are more likely to cause the problem, it could also be outdated data that your web browser has cached. This can result in you being logged out of WordPress.
To fix this, you just need to clear the cache of your web browser.
The process is identical to the last method, but instead of checking the box for cookies, you just need to check the Cached images and files box and click on the “Clear data” button.
Check your website by logging in and seeing if you have any problems. If not, then you’ve solved the issue.
Note: Clearing your cookies and cache will remove your saved passwords. This can make it harder to log into your favorite websites. That said, if you stored passwords in your web browser directly, like using Google Chrome, those passwords will still be stored. You’ll just need to set up the autofill options again. Just be sure to write down any important passwords before they are lost. A better practice is to use a password manager to protect that login information.
Method 3: Change Your Cookie Settings
This is more of a way to prevent the issue from occurring than to actually fix it. You see, there are settings in your web browser that can force cookies to expire after a certain amount of time has passed.
If this is set too low, well, you can run into this problem pretty often. Now, this shouldn’t be changed from the default value unless you specifically downloaded an extension to do so. Thus, you’ll need to use that extension to correct it.
Alternatively, you can reset the browser to default settings to correct the problem.
Another thing you should adjust is that your website has the proper permissions. Again, most sites will have this by default, but there is a chance your web browser has blocked your website’s cookies, which may have caused the error.
This is specific to your web browsing application. You will need to use instructions for your own browser. This tutorial is just for Google Chrome.
At the top-right of your Chrome browser, click on the three dots. Then click on the Settings option.
On the left-hand side, click on the Privacy and security option.
Once here, click on the Cookies and other site data option.
The first way to ensure you won’t have any issues is to allow your web browser to accept all cookies. This is not on by default to protect yourself from harmful cookies. Honestly, I would not recommend this approach, but it exists.
Instead, you just want to make sure your website is on the list of websites to always accept cookies from. To do so, click on the “Add” button and enter your website’s URL.
By taking these steps, you can help ensure that your browser will be less likely to ever cause you to be logged out of WordPress by mistake. It’s quick and easy, so be sure to do it ASAP.
Method 4: Clear Your Website’s Cache
Similar to how your web browser may be storing out-of-date information, the same can be happening on your website itself. Thus, you should clear your website’s cache.
There are multiple ways to go about this, but overall, it’s quite easy to do.
It really depends on how your website handles caching, which makes creating a tutorial for it to be challenging, thus, I will just provide a quick overview depending on how you handle things.
For most sites, you probably have a caching plugin installed. If you don’t, well take the time to add one now, because they are a great asset to every website and can seriously boost performance.
These plugins all have a built-in method to clear the website cache. Just refer to the plugin documentation to clear it.
Of course, you can also clear the cache from your website’s cPanel. And also again, this is different depending on how your website handles caching.
For instance, with GreenGeeks, you’ll have LiteSpeed Cache installed and active by default.
Just go to the Advanced options in cPanel and click on the LiteSpeed Web Cache Manager option.
From here, just click on the “Flush All” button.
This will be different from web host to web host. There are also other caching solutions like Redis that have their own way to clear the cache.
In any case, check to see if you have trouble staying logged in. If you’re still having problems, there are other methods to help fix WordPress from logging you out.
Method 5: Make Sure Your URL Matches the Site Address
I mentioned how cookies are usually the main culprit, and it’s time to check them from the source: your website. You see, the cookies your site generates could actually just not be correct, which forces you to be logged out.
This can occur when your URL does not match your site address in WordPress. This can happen in a variety of situations, but the most common one is if you install an SSL incorrectly, which could make you have one of these start with “HTTP” and the other “HTTPS.”
Luckily, this is incredibly easy to fix and takes less than a minute to verify.
On the left-hand admin panel, click on Settings and select the General option.
The third and fourth fields on this page should be WordPress Address (URL) and Site Address (URL). These values need to match. As I said earlier, the most common reason why these would be different is the “HTTP” or “HTTPS” prefix not matching.
You could also have one of these containing a “www” and the other not having it. Just make sure they match and save the changes if they do not.
This should fix any bad cookies your website is producing, but you will need to clear out your web browser’s cookies again. This is because the bad cookies could still be in place on your web browser.
Refer to Method 1 if you need help.
Method 6: See If A Plugin Is To Blame
The best part of WordPress is the huge library of plugins you can use, but sometimes they can be a double-edged sword. You see, plugins add a lot of extra features, but they are also can result in breaking your website for a myriad of reasons.
It is entirely possible that installing a new plugin or updating an existing one could result in WordPress continually logging you out.
First, take a minute and review your plugins. Did the problem occur after installing any plugins recently? Check your plugin update log, did the issue begin after a plugin was updated?
This can help you quickly zero in on which plugin is to blame. However, if you can’t remember which one it may have been, don’t worry. There’s a simple way to see if the problem stems from a plugin.
Log into the cPanel and click on the File Manager option.
Enter the public_html directory and click on the wp-content folder. Inside this, there should be a folder named plugins. Right-click on that folder and select the Rename option.
Rename the folder “testing” and click on the “Rename File” button.
WordPress will only recognize the folder name of plugins, thus, you have essentially deleted all of your plugins as far as WordPress is concerned.
To get those plugins back, you just need to rename that folder back to plugins to restore them.
More importantly, go back to your website and log in. If the problem is no longer occurring, then a plugin is to blame. If this is the case, rename the folder back to plugins to restore your plugins.
You’ll now need to disable each one and see if the error goes away. If it does, you have your culprit.
Note: Disabling your plugins should not mess up any settings. Most plugins store settings and information in the WordPress database. However, some may need initial setup, especially if they connect to a third party, such as when using Jetpack.
Method 7: Restore Your Website With A Backup
If all of these troubleshooting steps have failed, you have a really tricky issue on your hands. At this point, the quickest and easiest way to resolve the issue is to consider restoring your website before the error began.
This method is only viable if you kept a backup of your website. Most competent backup plugins and tools will keep several backups of your website, which help give you a lot of options.
Locate a backup from before the issue began and restore your website. This should resolve the issue. Just keep in mind that this is not an ideal outcome as you may lose changes you have made to your website such as new blog content.
A way to avoid this is to clone your existing website to a dummy website before restoring it from a backup. This will allow you to quickly copy any content that was lost as a result of restoring the website.
Still Logging Out of WordPress? Contact Your Web Host
If none of these troubleshooting steps fixed the issue of WordPress logging you out, you probably need some help to solve the problem, and your web host is the best place to get it.
Web hosts offer their customers excellent support that can help you troubleshoot problems on your website. Most web hosts provide support through a variety of channels such as phone support, email support, or even live chats.
If you are having trouble contacting your web host or you are not happy with the support, consider switching to a better web host.
Which method worked for you? How long has this error been present on your website?