How to Fix WordPress Keeps Logging Out Problem

Ninetheme

Have you ever encountered a logging out problem from WordPress panel before? One of our visitors told us that he encountered this problem and tried all possible ways, but could not solve the problem. He mentioned that although he tried many solutions such as disabling plugins, clearing the cache, clearing browser cookies he could not solve them anyway. So, we’re going to mention about how to resolve this issue in WordPress.

Why WordPress Keeps Logging Out?

First off, you need to understand how login into WordPress in order to understand this problem. WordPress places a cookie in your browser to verify the login session. This cookie is set for the WordPress URL that is located and stored in your settings section. If you’re trying to access your site from another URL in the current settings, it probably won’t validate your login session.

As you can see from the screenshot above, the WordPress URL and the site address URL are different, which is causing this trouble.

Fixing The Login Issue

There is actually a simple solution to this problem. What you need to do is to check to make sure that the WordPress URL and the site address URL are the same.

After login to your WordPress panel, navigate to Settings > General

If you’re unable to access to your WordPress panel,you need to access to your server, where your WordPress files are being stored, using a FTP client. Then, find the wp-config.php file in the root directory and then edit this file with note pad++. Then, copy paste the following snippet code at the top of your wp-config.php file.

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

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

Or, if you prefer to use www in your URL, then use the following snippet code.

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

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

Note! Please do not forget to replace your domain url with the sample example.com url provided.

Why Does This Solution Work?

In fact, technically, www itself is a domain name after all. This is regarded as if there are two different domains. So, if you make the URLs the same, the problem will be gone.

Also note that many redirection problems can also appear as a result of incorrect settings of site address URL  and the WordPress adress URL.

We hope this article helps you to understand this issue. We’d lov to hear your feedback if anything remains unclear or something you want to ask about this topic.