How To Fix WordPress Keeps Logging Out Problem

How To Fix WordPress Keeps Logging Out Problem

Last modified: September 19, 2020

FAQ
Cloudways

There can be a very frustrating problem with WordPress when the website will keep logging you out. You can try all sorts of solutions which are common with WordPress issues like resetting the theme to a standard theme, disabling plugins, emptying the cache, clearing the cookies within the browser.

The chances are that none of these will work. And you will still suffer from the website logging you out of the website all the time.

So, here is an explanation of what is happening and how to fix the problem.

Show More

* This button will show the rest of the post and open up an offer from a vendor

Why Does WordPress Keep Logging You Out?

When you login to your WordPress website, WordPress sets a cookie in your browser to authenticate the session. The cookie is set for the WordPress URL that is stored in the settings section of the WordPress admin.

If you’re accessing the site from a URL that doesn’t match the URL that is stated in the settings, then the website can’t authenticate the session. Therefore, you will be logged out, as if you’re a security threat in the website.

Fixing The Login Issue

There is a simple fix for the login issue. This is to ensure that the URL in the site address and the WordPress address fields stated in the WordPress settings match. There can be a common error that some website owners can make and not have both websites have the same setting when it comes with the www. Some website owners will have a site with the www but then leave it in on the settings.

To check this, login to your WordPress dashboard and then go to the settings option and then the ‘General’ tag. This will tell you if the settings are correct.

If this is impossible, then open up your WordPress website files using a FTP program. Then locate the wp-config.php file. Open this up so you can edit it. Then you need to add this line above the final line in the coding that reads: ‘That’s all, stop editing! Happy blogging.’

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

If you would prefer to use the www, the you can insert this in the appropriate place. The code should therefore read.

define('WP_HOME','http://www.example.com');
define('WP_SITEURL','http://www.example.com');

Be sure that you replace the example.com with the domain of your site.

When you make the edit, this should resolve the issue. Remember to save the file, and re-upload it to your file directory if you need to.

Of course, this might cause a problem where there are too many redirects in WordPress. However, this has another fix too that is detailed here.

Final Word: How To Fix WordPress Keeps Logging Out Problem

It is annoying if you can’t keep logged into your WordPress website. Luckily, there is a simple fix, as we’ve detailed above. However, if you’re still experiencing problems, then you might need to check that you’ve correctly diagnosed the problem.

Recap:
Save 4 Later
Email liked links to yourself