The “WordPress keeps logging me out” problem is a frustrating issue reported by many users. It is a “session timeout” error that occurs due to any of the various possible causes.
# Common causes include:
- An issue with the cookie set by WordPress for authenticating a login session.
- Mismatch of your WordPress URL settings.
- External Plugin related issue.
No matter what the underlying cause, you’ve landed at the right place. We have all the experience of knowing what to do when WordPress keeps logging you out! We’ll show you how to solve the error, so you won’t have to wonder why “WordPress keeps logging me out”, and instead know how to fix it immediately. So, let’s get started!
Upon embarking on the journey to fix the problem of being logged out of WordPress, we discovered certain fixes (i.e., the methods to follow), which we’ve listed and explained in-depth article.
Before moving on to the methods, as a precautionary measure, it’s essential to create a complete backup of your WordPress site. Next, we suggest these methods be followed one by one. The method with the highest probability of fixing the issue is listed first.
Want to edit and save your posts uninterruptedly, and access your main dashboard without further hassle? Below are the troubleshooting methods.
Methods to follow to resolve the issue “WordPress keeps logging me out”
1. Clear Your Browser’s Cache & Cookies
A common cause of the “WordPress keeps logging me out issue” is an issue with the cookie set by WordPress for authenticating a login session. The problem arises when the page you wish to access is cached in the browser, yet it can’t authenticate the session due to an expired cookie. To troubleshoot the issue, you should clear your browser’s cache first. If that doesn’t by itself resolve the error, then remove the cookies.
# Clearing The Cache
Before clearing your entire browser cache, you may want to try to “force refresh” a single page. If the issue is with a single page only, this step allows you to bypass the cache for the specific page that you’re on.
Here’s how you can “force refresh” a single page using simple hotkeys in different browsers:
- In Windows & Linux press CTRL + F5
- In Chrome & Firefox press CMD+SHIFT+R
- In Apple Safari, press the SHIFT+Reload toolbar button.
If the “force refresh” technique didn’t work, you should know that clearing your browser’s cache may not always fix the issue, either. However, it’s a sensible start to your troubleshooting journey.
Often users assume an issue to be some significant website bug. At the same time, it turns out a simple caching issue is quickly resolved by clearing your entire browser cache.
Next, we’ll go over the steps of how to clear the cache in Google Chrome and Mozilla Firefox browsers.
Easy Steps – How to Clear Your Browser Cache in Google Chrome:
Step 1 – Click on the three dots icon in the top right corner of your browser window.
Step 2 – Navigate to the ‘More tools’ option. In the submenu that opens, select ‘Clear browsing data.’ Or, use the hotkey combination: CTRL + SHIFT + DEL.
Step 3 – The tab titled ‘Clear browsing data’ will open. Check the box with the option ‘Cached images and files’ only since, at this point; you wouldn’t want to clear the browsing history, cookies, any saved passwords, etc.
Step 4 – In the same tab, select a timeframe where it says, “Obliterate the following items from.” It’s perfectly fine for the time frame selection if you choose the default option ‘the last four weeks.’ Next, click on the ‘Clear browsing data’ button, upon which your Chrome browser cache gets emptied.
Easy Steps – How to Clear Your Browser Cache in Mozilla Firefox:
Step 1 – Click on the hamburger icon (the three horizontal lines) in the top right corner of your browser window and select the ‘History’ option.
Step 2 – Select ‘Clear Recent History.’ Or, use the hotkey combination: CTRL + SHIFT + DEL.
Step 3 – In the pop-up window that appears, select ‘Everything’ in the “Time range to clear” drop-down menu. Further, check the ‘Cache’ box only not to end up clearing other essential browsing data.
Step 4 – In the same window, next click on the ‘Clear Now’ button, upon which your Firefox browser cache gets emptied.
# Clearing The Cookies
If clearing cache doesn’t fix the issue, there is a likelihood the problem is caused by a cookie already saved in your browser for the site. An expired cookie can cause an error. It tries to authenticate a recent login, yet it overrides it by mistake. To resolve this, you need to clear your browser’s cookies.
Next, we’ll go over the steps of how to clear the cookies in Google Chrome and Mozilla Firefox browsers.
Easy Steps – How to Clear Your Browser Cookies in Google Chrome:
Step 1 – Click on the three dots icon in the top right corner of your Chrome browser window and click on ‘Settings.’
Step 2 – Either navigate the ‘Privacy and Security’ section or click on the ‘Privacy and Security’ from the left-hand side menu. Then click on ‘Clear browsing data.’ You can also get to the ‘Clear browsing data’ section directly using this URL: chrome://settings/clearBrowserData.
Step 3 – Make sure to check the box next to the options’ Cookies and other site data’, ‘Cached images and files,’ and optionally the ‘Download history’ option. Choose a time range for how far back you want the cookies other checked data cleared. In the ‘Time range’ drop-down box, you may want to select ‘All time’ (recommended) if you want to delete everything.
Step 4 – Click on ‘Clear data.’ Wait for a couple of minutes for the process to finish.
Easy Steps – How to Clear Your Browser Cookies in Mozilla Firefox:
Step 1 – Click on the hamburger icon (three horizontal bars) in the top right corner of your browser window and select the ‘Preferences’ option.
Step 2 – In the new tab that appears, click on ‘Privacy & Security.’
Step 3 – Next, scroll down to the ‘Cookies and Site Data’ section. Then click on the ‘Manage Data’ button.
Step 4 – Now, the ‘Manage Cookies and Site Data’ pop-up will appear. Next, click on the ‘Remove All Shown’ button to delete the cookies.
Step 5 – Click on ‘Save Changes.’ Upon saving the changes, upon getting the ‘Removing Cookies and Site Data’ confirmation dialog, click ‘OK.’
Hopefully, the “WordPress keeps logging me out” issue would have resolved by having cleared your browser cache and cookies. If it still hasn’t, you should move on to the next method to resolve WordPress cache issues. But, before moving on to try that, you may want to stick around with the present method a bit longer to ensure your cookies are enabled.
Next, we’ll show you how to enable your Chrome browser to accept cookies:
Enable Your Browser To Accept cookies
Is your browser configured not to accept cookies? If yes, this might be why you keep getting logged out of WordPress and can’t access your dashboard.
Easy Steps – How to Enable Your Browser to Accept Cookies (Google Chrome):
Step 1 – Click on the three dots icon in the top right corner of your Chrome browser window and click on ‘Settings.’
Step 2 – Either navigate the ‘Privacy and Security’ section or click on the ‘Privacy and Security’ from the left-hand side menu. Then click on ‘Cookies and other site data.’
Step 3 – The ‘General settings’ dialogue will appear. Disable both the “Block all cookies (not recommended)” and “Block third-party cookies” options.
2. Resolve WordPress Cache Issues
If clearing your browser’s cache and cookies haven’t solved the issue, you can rest assured your browser isn’t at blame. There’s a chance your WordPress site’s cache may be the culprit of the “WordPress keeps logging me out” problem.
What is WordPress Caching?
WordPress caching helps significantly increase your site’s loading time and user experience through storing a copy of your website’s static pages on the browser, the server hard disk, or the RAM.
The WordPress caching system may pose a problem when it doesn’t pick up the changes you may have recently made to your website content. Although this may seldom happen, when it does, however, your site may display outdated content, or WordPress may keep logging you out.
To fix the issue, you should clear your server cache or the WP caching plugin you may have employed. To remove your site and server cache, you should check with your host for specific directions. In case you’re using a WordPress caching plugin, check the documentation for directions on clearing the cache.
Here’s how you can clear your WordPress cache if you’re using an external plugin like ‘WP Super Cache Plugin’, or ‘W3 Total Cache Plugin’:
# WP Super Cache Plugin from WordPress Dashboard:
Go to your WP Admin Dashboard > WP Super Cache > WP Super Cache Settings page > Delete Cache
# W3 Total Cache Plugin from WordPress Dashboard:
Go to your WP Admin Dashboard > Performance > W3 Total Cache Dashboard > Empty All Caches
3. Check Your WordPress URL Settings
It could be that the URL defined in the cookie does not match with the site address. WordPress login session cookies aren’t saved when that mismatch happens, and authentication doesn’t occur; hence, you keep getting logged out.
Our next method involves checking your WordPress URL settings so you can ensure the Site Address (URL) and WordPress Address (URL) fields match precisely.
The ‘WordPress Address (URL)’ is the location of all your WordPress site files. The ‘Site Address (URL)’ is the homepage users are directed to. Typically both these URLs are identical. A difference in the two can be the source of the error.
# Here’s how to check & update your URL settings:
Step 1 – Go to ‘Settings’> ‘General’, and make any necessary updations required to resolve the error.
Step 2 – Removing www at the beginning of each URL and keeping them as http://salvattore.com (i.e., your site URL) and then reloading the site might fix the issue.
Conversely, adding www at the beginning of each URL (if it’s currently not there) and keeping them as http://www.salvattore.com and then reloading the site might fix the issue.
If one of the URLs has www at the beginning, then ensure either both have it or neither has it so that they’re identical.
Step 3 – Ensure you have an “https” prefix in the URL if you have an SSL certificate installed on your domain.
Step 4 – If you’ve made any updations, save your changes at the bottom of the page.
# Can’t access your admin dashboard? You may check and update the URLs manually, as shown below:
Step 1 – Make a backup of your entire website.
Step 2 – Edit your wp-config.php file by connecting to your server via retrieving your FTP credentials, or choose an FTP client of your choice, for example – FileZilla.
Step 3 – Once you’re connected to your server, navigate to the public_html directory and open it.
Step 4 – Locate your ‘wp-config.php’ file, right-click it, and choose the ‘View/Edit’ option.
Step 5 – Look for the following code, and ensure the URLs match. In the case of non-matching URLs, make appropriate changes. Remember to change the URL to your site URL.
define (‘WP_SITEURL’, ‘https://example.com’);
define (‘WP_HOME’, ‘https://example.com’);
If you don’t see the above code lines in your wp-config.php file, look for the line reading “happy blogging,” and add the two lines of code above it.
Step 6 – Once done, save and close the file. A prompt by FileZilla asking you to re-upload wp-config.php to your server will appear.
Step 7 – Select ‘Yes’ and then close the server connection. Try reloading your site to check if the problem is solved.
For a more descriptive overview of how to manually update your WordPress URL settings, do read the relevant section of our insightful article on ‘How to Fix “ERR_TOO_MANY_REDIRECTS” on WordPress?’
4. Find & Delete Any “Bad” WordPress Plugin(s)
As a final resort, for resolving the “WordPress keeps logging me out” issue, you will have to find out if a plugin you have installed is the source of the issue. A plugin has to be set up correctly for it to authenticate the login session with a cookie.
Any issue with the cookie or the plugin will lead to the WordPress login “session timeout” problem. Since you are unlikely to have access to your WP-Admin area, you would be required to manually disable your plugins.
Step 1 – Connect to the server via your FTP credentials.
Step 2 – Navigate to the root WordPress directory called public_html.
Step 3 – Open the wp-content subdirectory and right-click on the plugins folder there.
Step 4 – Click on the Rename option in the drop-down list.
Step 5 – Rename the plugins folder to plugins_disable or plugins_deactivated to deactivate all plugins in one go.
Step 6 – Rename the plugins_disable folder back to its original name “plugins.” Then refresh your WordPress site and access your wp-admin area.
Step 7 – Check to see if the problem is solved.
If the error no longer persists after the above steps, we know a faulty plugin was the culprit. Next, You should delete the problematic plugin from your admin dashboard.
# Here are the steps to follow for finding and deleting the problematic plugin:
Step 1 – Navigate to ‘Plugins’> ‘Installed Plugins’ to manually activate all your plugins.
Step 2 – Log out of your admin dashboard.
Step 3 – Connect to the server via your FTP credentials.
Step 4 – Open the wp-content subdirectory and right-click on the ‘plugins’ folder there. Your plugins folder should be at the location of your-site/wp-content/plugins.
Step 5 – Select a plugin and right-click on its folder, then click on the ‘Rename’ option.
Step 6 – Rename the selected Plugin folder, for instance, plugin-name.old or plugin-name.deactivated.
Step 7 – Log in to your dashboard again. If, after deactivating the previously selected plugin, you can log in to your dashboard, then it’s confirmed the plugin you just disabled by changing its folder name is the culprit. If not, move on to step 8.
Step 8 – Deactivate the rest of the plugins one by one and reload your site each time to find out the bad plugin.
Suppose you’re able to log in to your dashboard after you’ve just deactivated a specific plugin. In that case, it’s confirmed that plugin was the culprit.
Step 9 – Permanently delete the confirmed bad plugin by accessing the public_html/wp-content/plugins folder from your File Manager.
To replace the plugin you deleted, you can opt for a suitable alternative plugin. Alternatively, you may contact the plugin’s author to apprise them about the issue and request a fixed version.
For a more descriptive overview of how to manually disable and re-enable WordPress plugins, scroll down to the relevant section of our article titled “How To Fix “503 Service Temporarily Unavailable” On WordPress?”
You should always ensure you have kept a complete backup of your WordPress site. In case none of the above methods work, by having the backup of your entire site, you can keep your traffic, sales, and SEO losses at bay by being able to restore your site in no time!
Luckily, the “WordPress keeps logging me out” problem is easy to fix. Instead of wondering what to do when WordPress keeps logging you out, you can make sure of the following:
- Clear Your Browser’s Cache & Cookies
- Resolve WordPress Cache Issues
- Check Your WordPress URL Settings
- Find & Delete Any “Bad” WordPress Plugin(s)
Are there other incredible methods that worked for you in resolving this issue? If yes, please use the comment section below.