Have you ever encountered the frustrating problem where WordPress keeps logging you out? Recently one of our users encountered this issue. She followed all the traditional troubleshooting tips like deactivating plugins, emptying cache, clearing browser cookies, and even restoring WordPress from backups. None of the above worked for her. If you’re facing this issue, then we have an answer for you. during this article, we’ll show you ways to repair the WordPress keeps logging out problem also referred to as WordPress session timeout issue.
Why WordPress Keeps Logging Out?
To know why WordPress keeps logging you out, you would like to know how the WordPress login process work.
WordPress sets a cookie in your browser to authenticate a login session. This cookie is about for the WordPress URL stored in your settings section. If you’re accessing a URL that doesn’t match the one in your WordPress settings, WordPress won’t be ready to authenticate your session.
Fixing The Login Issue
A simple fix for this login issue is to form sure that you simply have an equivalent URL in your Site Address and WordPress Address fields in your WordPress settings. this suggests that you simply got to choose either www or a non-www URL within both fields.
Login to your WordPress dashboard and attend Settings » General.
If you can’t access the admin area, then you’ll update these fields by editing the wp-config.php file.
Connect to your website using an FTP client, and locate the wp-config.php enter your site’s root directory. you would like to download this file to your Desktop and open it during a text editor like Notepad. Add this code just above the road That’s all, stop editing! Happy blogging.
If you favor to use www in URL, then use this code instead
Don’t forget to exchange example.com together with your own name.
1. Clear Your Browsing Data
The first solution you can try is clearing your browser’s cookies and cache. Your site may be trying to use an expired cookie to verify your login credentials.
This process can vary a bit depending on which browser you’re using. I’ll demonstrate with Chrome since it’s the most popular option. First, access your browser settings by clicking on the three-dot icon in the top-right corner of the window:
You can navigate to Privacy and security > Clear browsing data from the primary settings screen, or for a shortcut, select More Tools > Clear browsing data from the settings menu:
In the resulting window, make sure Cookies and other site data and Cached images and files are both checked. Then, click on Clear data:
Check your WordPress site to see if it worked. If you’re still being logged out repeatedly, you can try the next solution.
2. Clear Your Site Cache
If you’re using a caching plugin to help speed up your site, you may also need to clear your site’s cache. You can usually find this option in your caching plugin’s settings:
3. Check Your Browser’s Cookie Settings
It’s also possible that your browser is configured so that it doesn’t allow cookies for your WordPress site. Checking this issue will vary a little bit depending on which browser you’re using. Here, I’ll show you how to find the proper settings in Chrome.
First, head to your Privacy and security settings:
4. Verify that Your WordPress Address and Site Address Match
If none of the fixes above have worked, it might be that the URL address on your WordPress site’s cookies doesn’t match your Site Address. To check this, navigate to Settings > General in your WordPress dashboard:
Make any necessary changes and save your settings. If you’re having trouble completing this task because WordPress keeps logging you out, you can specify your WordPress Address and Site Address in your wp-config.php file instead.
To access it, you’ll need a File Transfer Protocol (FTP) client such as FileZilla and your FTP credentials which are provided by your host. Enter them into your FTP client to connect to your server, and then look for wp-config.php in the public_html directory:
5. Troubleshoot for a Plugin Error
To test your plugins, I recommend that you create a staging site that allows you to perform this action safely, outside of your live site.
First, deactivate all of your site’s plugins using the Bulk actions feature on the Plugins screen:
6. Change How Long WordPress Should Remember Users
Finally, you can change the length of time WordPress should remember users who have checked the Remember Me box on the login screen:
Why does this solution work?
Technically speaking, www maybe a subdomain itself. this suggests that URLs with www and without it are literally two different domains.
By changing and updating the URLs to an equivalent address, it’ll fix the difficulty.
A more detailed technical explanation of www vs naked domain is here.
Also, it’s important to notice that incorrect WordPress Address and Site Address fields can also result in too many redirect issues in WordPress.
We hope this text helped you fix the WordPress session timeout issue. If it doesn’t then check out the way to fix WordPress login page refreshing and redirecting issue.
It can be annoying to try and work on your site when WordPress keeps logging you out. Fortunately, there are several quick fixes you can try to get back to your uninterrupted workflow.
In this tutorial, we reviewed several potential solutions for this problem. You can start by clearing your browsing data and your site’s cache as well as checking your browser’s cookie settings. If that doesn’t work, check your WordPress and Site Addresses, troubleshoot for a plugin error, or extend the allowed session duration.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.