Skip links
Logging Out Problem

How to Fix WordPress Keeps Logging Out Problem

Are you trying to stop WordPress from logging you out all the time problem? This is a usual WordPress problem that makes it almost difficult to work on your website.

In this article, we will show how to fix the WordPress frequently logging out problem, also known as the WordPress session timeout issue.

There are many main reasons why WordPress keeps logging you out. Most of the time, however, you are attempting to visit your site using a URL that does not match the one specified in your WordPress settings.

When you log in to your WordPress website, it will create a cookie in your browser to verify the login. The cookie is set for the WordPress URL found in your settings menu.

If the site URL and the WordPress URL do not match, WordPress will be impossible to authenticate the session and will log you out. This can also lead to the WordPress “too many redirects” issue. The ‘WordPress Address’ and ‘Site Address’ in the image below differ, resulting in a conflict.

Site Address

With that said, let us show you how to simply resolve the WordPress keeps logging out the issue.

How to Fix WordPress Keeps Logging Out Problem

To fix this login problem, ensure that the ‘Site Address’ and ‘WordPress Address’ fields include the same URL.

To do this, go to Settings » General in your WordPress admin panel.

WordPress Address

Next, double-check that the URLs match. You must enter either a ‘www‘ or a ‘non-www‘ URL in each field.

Technically, ‘www‘ is a subdomain. This means that URLs with and without ‘www‘ represent two distinct domain names.

Fortunately, modifying and updating the URLs to the same address resolves the issue. Then, be sure to click the ‘Save Changes‘ option.

Fixing the WordPress keeps logging out the problem by adding code to WordPress

If you can access your WordPress dashboard, you will need to manually change the wp-config.php file. This is a specialized file that contains critical WordPress settings for your website.

To accomplish this, use FTP software such as FileZilla or the file manager tool in your WordPress hosting account control panel.

For more information about FTP, please check our beginner’s guide on uploading files to WordPress.

Then, find the wp-config.php file in your site’s root directory.

Download the file to your desktop and open it with your choice text editor, such as Notepad.

After that, place the following code above the line that reads, ‘That’s all, quit editing! Happy publishing:

define('WPDruggy_HOME','https://abc.com');
define('WPDruggy_SITEURL','https://abc.com');

If you want to include ‘www’ in the URL, you can use the following code:

define('WPDruggy_HOME','https://www.abc.com');
define('WPDruggy_SITEURL','https://www.abc.com');

Make sure you change the ‘abc.com’ URL with your WordPress blog URL.

Next, please save the file and upload it back to your root directory. WordPress should no longer log you out when you check in to your website.

If you’re still having trouble logging out, read our advice on fixing the WordPress login page refreshing and redirecting issue.

Frequently Asked Questions About WordPress Logging Out

Here are the answers to the most frequently asked questions concerning WordPress logging out.

Why is WordPress logging me out?

In the majority of cases, WordPress continually logs you out because you are trying to access your website using a URL that does not match the one specified in your WordPress settings.

When you log in to your WordPress website, it saves a cookie in your browser to validate the login session. The cookie is saved for the WordPress URL in your settings menu.

If the site URL and the WordPress URL are not the same, WordPress will be unable to authenticate the session and will log you out.

How long does WordPress take to log you out?

A basic WordPress login session will expire in 48 hours. Then WordPress will log you out, and you must log back in.

To get around this, tick the option next to ‘Remember Me’ on the WordPress login screen. Then you won’t be required to log in again for 14 days.

Also Read More Blogs

To summarize, resolving the issue of WordPress continually logging out requires a systematic approach that addresses probable causes such as plugin issues, cookie settings, or server-related difficulties. Users may restore uninterrupted access to their WordPress dashboard and ensure a seamless user experience for themselves and their visitors by thoroughly evaluating each potential cause and implementing the right fixes. Regular maintenance, remaining up to current with WordPress core, themes, and plugins, and following security best practices can all assist in preventing such situations in the future. With patience and dedication, WordPress users can successfully overcome the logging-out issue and enjoy a reliable and secure website environment.

Leave a comment

This website uses cookies to improve your web experience.
Home
Account
Cart
Search
Explore
Drag