Overview
You’ve come to the right place if you’re constantly getting the “WordPress keeps logging me out” error message.
The most common reason of this problem is a problem with the cookie that WordPress tries to set to validate a login session. It could potentially be a problem with some mismatched WordPress URL settings.
Here’s how to troubleshoot and fix the WordPress session timeout problem, regardless of the cause.
Contents Table of Contents
Clear the Cache in Your Browser
Clear the Cookies in Your Browser
Make sure your browser’s settings are correct.
Clear the Cache on Your WordPress Site
Disable and re-enable WordPress plugins after double-checking your WordPress site’s address
Despite this, WordPress keeps logging me out.
1. Delete the Cache in Your Browser
Your browser could be causing the “WordPress keeps logging me out” problem. It’s possible that the page has been cached in your browser and is attempting to authenticate the session using an expired cookie.
If this is the case, clearing your browser’s cache will resolve the problem. For further information, see How to Clear Your Cache in All Major Browsers.
2. Delete Cookies from Your Browser
Similarly, the problem could be with the site’s cookie that has already been saved in your browser. It’s possible that the issue is caused by a cookie that has expired but has accidentally overridden your recent login.
Fortunately, you may resolve the issue by clearing your browser’s cookies.
Step 1: Install Chrome
Go to the top right-hand corner of Chrome and click the More icon. It has the appearance of a hamburger icon: There are three vertical lines or dots in total.
Step 2 Select More Tools > Clear Browsing Data from the drop-down menu.
The “Clear Browser Data” option is highlighted in the Chrome browser.
Clear your browsing data in Chrome’s settings.
3rd step
Select a time range for how far back data should be cleared near the top of the pop-up. Select All time from the drop-down box to erase everything.
4th step
Check the boxes for Cookies and other site data, as well as Cached pictures and files. You can also tick the Browsing history option if you like.
Chrome preferences
To delete cookies and cached images, check the box.
5th step
To clear the data, press the Clear data button. It may take a few minutes to complete the procedure, depending on how much data needs to be deleted.
Step 1 of Safari
To clear cookies in Safari, go to the menu bar and click Preferences.
Menu in Safari
Step 2: Go to Safari’s Preferences menu.
Then, on the Privacy page, click the Manage Website Data button.
Safari’s settings
In the privacy settings, click the Manage Website Data tab.
3rd step
To erase all cookies from Safari, click the Remove all option.
Privacy settings in Safari
To erase all cookies from Safari Firefox, click the icon.
After you’ve opened Firefox, go to the top-right corner and click the hamburger settings symbol. From the drop-down menu, choose Preferences.
Drop-down menus in Firefox
From the menu icon, select the Preferences option.
2nd Step
A new tab with settings will open. In the left-hand menu, select Privacy & Security. Click the Manage Data button after scrolling down to the Cookies and Site Data section.
Preferences for Firefox
Select Manage Data from the drop-down menu.
3rd step
To erase the cookies, click the Remove All Shown option in the pop-up that displays. Then press the Save Changes button.
Pop-up “Manage Cookies and Site Data” in Firefox
By clicking the Remove All Shown option, you can delete all cookies.
Edge
1st step
Click the ellipsis in the top-right corner of your browser to close it. Then select History > Clear Browsing Data from the drop-down menu.
Settings for the menu on the edge
You can also erase cookies if you click to clear your browsing data. Step 2
Make a time range decision that works for you in the Time range drop-down box. Consider how long the “WordPress keeps logging me out” problem has existed. Select a period of time that is at least as lengthy.
For example, if the problem has only lasted a few minutes, the default Last Hour selection should suffice. You can also select an other range, such as All Time, if you want.
Pop-up to clear browsing data
Select a time range for which all cookies will be erased.
3rd step
After that, double-check the boxes for Cookies and other site data, as well as Cached Images and files. You can also choose to erase your browsing and download history if you want to.
After that, use the Clear Now option.
3. Examine your browser’s options.
If it doesn’t work, the issue could be related to the cookie settings in your browser. They need to be modified if they’re set to compel cookies to expire.
In this case, the actions listed below should work regardless of the browser you’re using.
Step 1: Install Chrome
Select Settings from the menu icon in the top right corner of Chrome.
Chrome menu (ALT)
In the menu, select the Settings option.
2nd Step
A new tab with numerous options will open. Select Advanced from the drop-down menu at the bottom of the page.
Chrome’s preferences page
At the bottom of the options screen, click the Advanced button.
3rd step
A dynamically generated list of additional possibilities will display. Under the Privacy and Security section, select Site Settings.
Advanced options in Chrome
Step 4: Change the way websites save cookies by going to Site Settings.
Find the Cookies and site data settings in the Permissions section. Click on it if it doesn’t have the label Allow site to save and read cookie data beneath it and it says Blocked.
Otherwise, the “WordPress keeps logging me out” problem isn’t caused by this. You can skip down to the following section for more troubleshooting in this scenario.
Site settings in Chrome
You must modify your site settings if cookies are prohibited.
5th step
Under the Cookies and site data section, click the toggle button next to the Blocked label. Once you’ve done that, it should switch and alter to allow you to save cookies.
Options for cookies and site data in Chrome
Toggle the button to allow sites to save cookies Safari Step 1
Select Preferences from the menu in Safari.
Menu in Safari
You can verify your browser’s settings by going to Preferences > Preferences > Preferences > Preferences > Preferences > Preference
2nd Step
Select the Privacy option from the drop-down menu. Make sure the Block all cookies box isn’t ticked next to the Cookies and website data option. Click it if it’s checked. The modification will be saved automatically.
Privacy settings in Safari
Step 3: Make sure Safari isn’t blocking cookies.
Check to see whether the “WordPress keeps logging me out” problem has been resolved. If the problem persists, you can uncheck this box again to prevent your browser from saving cookies.
Next, make sure Prevent cross-site tracking isn’t ticked next to Website tracking. If it is, select it.
Privacy settings in Safari
To avoid cross-site tracking in Firefox, uncheck the box.
1st step
Open Firefox and go to the default new tab page and click the gear icon. It’s the page where all of your favorite websites are listed.
The icon may be found in the upper right corner of the page.
Firefox’s new tab page
Click the gear icon in a new tab.
2nd Step
A new tab with settings will open. Then, in the left-hand menu, select Privacy & Security.
Do you want to discover how we grew our traffic by over 1000%?
Join the 20,000+ people who receive our weekly email with WordPress insider secrets!
Now is the time to subscribe.
Select the Standard option in the Enhanced Tracking Protection section.
Continue troubleshooting if this option is already selected.
Privacy settings in Firefox
For Enhanced Tracking Protection Edge, make sure the Standard option is selected.
With your browser open, go to Settings by clicking the hamburger button at the top right.
menu of edge settings
Step 2: Change the way Edge saves data by going to the settings.
Find the Cookies and site data button under the Site Permissions tab. Click on it if it has the term “Blocked” underneath it.
If it shows “Allowed” on the other hand, keep troubleshooting.
Permissions for the site on the edge
If cookies and data are being blocked, select the option to unblock them.
3rd step
Toggle the Allow sites to save and read cookie data toggle button. This change is saved automatically.
Page for configuring site permissions
Step 4: Confirm that cookies can be saved in Edge.
Check to see whether the “WordPress keeps logging me out” problem has been resolved. Alternatively, if it’s already enabled, make sure the Block third-party cookies toggle button is turned off.
If you want to see if the “WordPress keeps logging me out” error is still happening and it’s becoming a bother, click the Add button next to Allow.
Page with settings for Edge
Try adding the error-prone site to the list of permitted sites.
5th step
In the text field, type the URL of the site that’s giving you issue with the “WordPress keeps logging me out” error. After that, click Add.
Create a new site pop-up
4. Enter your website’s URL and click the Add button. Clear the Cache on Your WordPress Site
If you’ve made it this far and the problem persists, it’s not your browser’s fault. However, the cache on your WordPress site could be the source of the “WordPress keeps logging me out” problem.
But don’t worry… There are still a few options available!
Your site’s cache can be cleared in a few clicks, but the procedure varies based on your server and whether or not you’re using a caching plugin.
Check the docs for any caching plugins you’re using.
Otherwise, contact your host for instructions on how to clear your site’s and server’s cache.
If you’re using Kinsta to host your site, cleaning the cache is simple; for more information, see How to Clear WordPress Cache On Your Site.
5. Double-check the URL of your WordPress site.
Because the URL indicated in the cookie does not match the site address, WordPress login session cookies aren’t always stored.
Do you have troubles with downtime with WordPress? Kinsta is a hosting solution that prioritizes performance and security. Take a look at our plans.
Check your WordPress settings to ensure that the Site Address (URL) and WordPress Address (URL) boxes are identical.
1st step
Go to Settings > General in the menu after logging in to your site. Then, as needed, update the addresses and double-check that they’re correct.
It’s possible that a “www” prefix is present when it shouldn’t be. Also, if your domain has an SSL certificate configured, make sure there’s a “https” prefix.
If you made any changes, scroll down to the bottom of the page and click Save Changes.
Page of the WordPress admin settings
Make sure your WordPress URLs are right and match.
Updating WordPress Addresses by Hand
If that doesn’t work, you’ll have to manually adjust these addresses to fix the “WordPress keeps logging me out” bug.
To do so, modify the wp-config.php file in your WordPress installation.
You can do this via SFTP, which you can learn more about here: How to Use SFTP to Connect to Your WordPress Site.
Step 1: Download and open the file once you’ve established an SFTP connection to your site. If you’re using FileZilla, you can also right-click on the file and choose View/Edit from the menu.
A file is selected in the FileZilla client, then right-clicked.
Step 2: From FileZilla, you can edit a file directly.
Enter the code below above the “happy blogging” line:
define(‘WP HOME’,’http://your-site.com’); \sdefine(‘WP SITEURL’,’http://your-site.com’);
Make sure “http://your-site.com” is replaced with your actual domain. Also, double-check whether you’re using “HTTP” or “HTTPS” correctly.
If your website has an SSL certificate installed, you should use the “HTTPS” prefix.
Check out How to Redirect HTTP to HTTPS in WordPress for more information.
There is also no “www.” prefix in the case above. If your site has one and it’s set up in your domain’s DNS settings to be used that way, make sure to include it.
3rd step
Save the file and place it in the main folder of your website. Alternatively, if you’re using FileZilla, return to the client and select Yes when prompted to save the modified version of the file to your server.
In FileZilla, the prompt for the file has changed.
When prompted to upload the modified file, select Yes. 6. Disable and re-enable WordPress plugins
If you’ve gotten this far and still can’t get the “WordPress keeps logging me out” error to go away, there could be a problem with one of the plugins you’re using.
When a plugin uses a cookie to verify the session, but the cookie isn’t set up correctly or there’s a problem with the cookie, the WordPress login timeout error can occur.
You must manually disable your plugins to troubleshoot this possible reason. Check out How to Disable WordPress Plugins for more information (No Access to WP-Admin).
1st step
Rename the plugins folder in /wp-content/ using SFTP. To avoid future confusion, use a name that is easy to understand.
Step 2 Refresh your site to see whether the “WordPress keeps logging me out” problem is gone.
If the problem has been resolved, rename the plugins folder to its original name. Then, in your browser, refresh the page.
Step 3 Navigate to Plugins > Installed Plugins and activate each plugin one at a time until the error reappears.
Page of installed plugins
Activate each plugin until the session timeout problem in WordPress appears.
4th step
You may delete the plugin that is causing the “WordPress keeps logging me out” issue now that you know what it is.
Stay on the Plugins page and click Deactivate under the mentioned problem plugin if you still have access to your site. Then, next to the Activate link, click the Delete button.
Page dedicated to plugins
Deactivate and remove the offending plugin.
If you don’t have access to your site, you can rename the plugins folder using SFTP and subsequently rename it to its original name.
Then, on your browser, refresh your page and delete the plugin.
If you need to use the plugin’s functions right away, you can now look for a suitable replacement. Otherwise, you can report the problem and seek a patch by contacting the plugin’s author.
7. Despite this, WordPress still logging me out.
If the “WordPress keeps logging me out” problem persists, you can manually extend the period that a user is remembered by checking the “Remember Me” box.
This is also useful if the default isn’t long enough, or if the timing was modified before and it no longer works for you.
Updating Manually How Long Will People Remember You?
1st step
If you haven’t previously, create a child theme with a functions.php file. For further information, see How to Create a Child Theme in WordPress (Extended Guide).
Add the following filter to your child theme’s functions.php file:
‘auth cookie expiration’, ‘keep me logged in for 1 year’; add filter(‘auth cookie expiration’, ‘keep me logged in for 1 year’);
keep me logged in for a year($expirein) is a function that keeps me logged in for a year. return YEAR IN SECONDS; / One year measured in seconds
It’s worth noting that the above filter will keep track of a user for a year. If you wish, you can replace “YEAR IN SECONDS” with one of the following options:
DAY IN SECONDS – Each user is only recognized for one day.
WEEK IN SECONDS – One week in seconds.
MONTH IN SECONDS – This is used to keep track of users for a month.
Provided you’re creating locally, keep in mind that allowing your user account to be kept for a year may not pose a significant security risk if your machine is safe and you run an antivirus app. It is not, however, secure for production or staging sites.
You may also want to avoid making the adjustment that allows users to be remembered for one day, as this may reintroduce the “WordPress keeps logging me out” problem.
Consider your alternatives and select the value that best suits your needs.
Is WordPress preventing you from logging in? What a pain! But, hey, one of these approaches can help you solve this vexing problem! 🚪🔑
TO TWEET, CLICK HERE
Summary
It’s really aggravating when WordPress continually logging you out.
Fortunately, in the vast majority of circumstances, the WordPress session timeout that causes the “WordPress keeps logging me out” problem may be readily remedied. Make sure to pay attention to the following details:
Clear the Cache in Your Browser
Clear the Cookies in Your Browser
Make sure your browser’s settings are correct.
Clear the Cache on Your WordPress Site
Disable and re-enable WordPress plugins after double-checking your WordPress site’s address
Manually Update How Long Will People Remember You?
If you’re hosting your site with Kinsta and need assistance, please don’t hesitate to contact us. WordPress specialists are standing by to assist you.