How to Fix WordPress Keeps Logging Out Problem

WordPress sets a cookie in your browser to authenticate a login session. This cookie is set for the WordPress URL stored in your settings section. If you are accessing from a URL that does not match the one in your WordPress settings, then WordPress will not be able to authenticate your session.

As you can see in the settings screenshot above, the WordPress URL and the Site Address are two different URLs (notice one has www. and the other doesn’t).

Fixing The Login Issue

A simple fix for this login issue is to make sure that you have the same URL in your Site Address and WordPress Address fields in your WordPress settings. This means that you need to choose either www or a non-www URL in the both fields.

Login to your WordPress dashboard and go to Settings » General.

If you can’t access the admin area, then you can update these fields by editing the wp-config.php file.

Connect to your website using an FTP client, and locate the wp-config.php file in your site’s root directory. You need to download this file to your Desktop and open it in a text editor like Notepad. Add this code just above the line.

Tables can't be imported directly. Please insert an image of your table which can be found here.

1 2

If you prefer to use www in URL, then use this code instead

Tables can't be imported directly. Please insert an image of your table which can be found here.

1 2

Don’t forget to replace example.com with your own domain name.