wordpress keeps logging me out

WordPress is the IKEA of digital space. It is an ultra-popular CMS brand that needs no advertisement. It is synonymous with website development.

In fact, 42.9% of the world’s websites are built with WordPress. For the most part, WordPress works flawlessly, but issues do arise due to various technical and human errors.

One of these burning issues is WordPress keeps logging out of the dashboard, which feels like being unable to enter your house.

It is a dreadful situation because the reason for WordPress login issues can range from a cookie expiration to a cyber attack.

This article will explore why you are getting logged out of your WordPress Dashboard and offer various solutions.

Why Does WordPress Keep Logging Me Out? And How To Fix It?

Ideally, a WordPress website runs perfectly well. But issues can arise due to poor configuration, server errors, faulty plugins, exceeding login attempts, etc.

You can follow the correct WordPress website development approach to nip some login issues in the bud.

To take care of the other issues, use the below-mentioned ‘WordPress keeps logging me out’ solutions.

Note: I have listed the solutions according to their difficulty level. Try them all one by one to resolve the login issue.

1. Clear Your Browsing Data

While focusing on why you can’t log in to WordPress, you almost always blame the website itself.

However, the problem may originate from your browser’s end.

When you visit the WordPress admin page, it creates a Unique Random ID for you and stores it in the cookie. The servers use the cookies to fetch the unique ID and authenticate users.

So, a login error can occur if the cookie expires.

The cookie’s contents are stored locally in the browser and the server. Whereas, cache stores the website content in the browser only and requires manual deletion.

You can clear your browser cache and cookies to resolve the “WordPress Keep Logging out” issue.

Google Chrome users can follow these steps: 

Clearing google cookies to solve wordpress logged out issues

  • Click on the Menu button and open History. Or press CtrlL+H to open the history tab.
  • Click on Clear Browsing Data. Next, the clear browsing data popup will appear.
  • Switch to the Advanced section.
  • Select “Cookies and other site data” and “Cached images and files” and clear the data.

Mozilla Firefox users can follow these steps: 

fix wordpress logging out issues by deleting cookies

  • Open the menu by clicking on the Menu button from the upper-right corner.
  • Go to Settings > Privacy & Security.
  • Scroll down to “Cookies and Site Data” and click on “Clear Data
  • Select cookies and cache and hit the clear button.

Safari users can follow these steps: 

safari cookie settings

  • Open the browser and click on Preferences from the menu bar.
  • Next, go to the Privacy tab and click on Manage Website Data.
  • Lastly, hit the Remove All button to clear the cookies.

Similarly, you can delete the cache and cookie data from other browsers.

2. Check Your Browser Settings

Cookies enable the WordPress website to authenticate you. However, your browser settings may hinder this process.

You need to check if the cookie creation is blocked from your end, resulting in the “WordPress keeps logging me out” problem.

If you’re on Google Chrome, go to the Privacy & Security settings.

allow all cookies

Here, ensure that Block third-party cookie and Block all cookies options are not enabled cause it would hamper WordPress from generating essential cookies.

Instead, click on the Allow All Cookies button, and you will be able to prevent websites from logging out.

3. Match Your WordPress Address and Site Address

You might not be able to log in to the WordPress website because your browser is using an incorrect URL to access it.

As you already know, cookies are essential for the login process. If the website URL stored in the cookies doesn’t match the one stored in your WordPress settings, the session authentication will fail, and WordPress will keep you logged out.

Go to Settings > General from your WordPress admin panel to ensure your site’s URL is set correctly. This section contains two website URLs – the Site Address and the WordPress Address.

match wordpress url

Both URLs should match perfectly and save your changes. You should add the “HTTPS” prefix if you have an SSL certificate installed for your site.

However, if you can’t access your WordPress admin, there is another way to solve this problem.

Edit the Codes To Solve the “WordPress Keeps Logging Out” Issue

The wp-config.php file is the most essential file for a WordPress installation. It is created as you set up your WordPress during the installation process and contains your website’s base configuration details.

If you can’t log into WordPress, use the FTP client or access the File Manager from your web host’s control panel.  I prefer using FileZilla which is an open-source FTP client.

In the root directory, you will find the wp-config.php file. You can download the file and use a text editor to make changes to it.

Note: Don’t use Word Processors for editing WordPress files.

Open the wp-config.php file, and find the /* That’s all, stop editing! Happy publishing. */, and place the following code above it:

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

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

Carefully replace the http://example.com value with your domain name. Also, add the www version of your website, if it has a www URL.

After editing, save the file and upload it to the directory to implement your changes.

Now, you will be able to log into your WordPress website.

4. WordPress Session Timed Out

The default WordPress session limit is 48 hours for obvious security reasons. This can’t exactly be the reason for frequent session expirations, but extending the session limit will reduce the number of logins.

To increase the session duration, you need to create a child theme and make changes to the functions.php file.

Note: Creating a child theme is an advanced process. If done incorrectly, more problems will pile up. So, rely on a WordPress expert to do this job. If you are a WordPress expert, then more power to you.

What are my suggestions for creating a child theme?

  • Backup your WordPress website
  • Reach out to a WordPress expert
  • Keep the troubleshooting methods ready

Follow this step-by-step guide to create your child theme.

How to modify the functions.php file?

  • Log in to your WordPress Dashboard
  • From the Admin panel, go to Appearance > Editor.

editing theme funtions.php file

  • You should be able to see the theme code.
  • Locate and open the functions.php file to edit. It is in the top-right corner of the page.
  • Scroll down to the bottom and add the following code:

add_filter( ‘auth_cookie_expiration’, ‘keep_me_logged_in_for_1_week’ );

function keep_me_logged_in_for_1_week( $expirein ) {

return WEEK_IN_SECONDS; // 1 week in seconds


  • Afterward, click on the Update File button to save your changes.

This code is for extending your default session duration to a week. You can make it even longer by replacing the word “WEEK” with month or year.

5. Deactivate Faulty WordPress Plugins

If you are still wondering, “why does WordPress keep logging me out?” Don’t worry! I have more solutions for you.

WordPress is the most popular CMS with more than 50,000 plugins to extend its functionalities. Sometimes, these plugins can negatively affect your website performance due to poor coding, bugs, compatibility issues, delayed updates, etc.

On average, a business WordPress website uses 20-30 plugins. In some cases, the number of active plugins can reach up to 50.

Now, all WordPress plugins are tested for compatibility, but issues can still occur as they interact with various elements on your website. As a result, you might be getting logged out of your WordPress Dashboard.

First, if you have a large website, I’d recommend getting custom plugin development services to get a software solution that suits your needs.

If the plugin malfunction is the cause of the WordPress log-out issue, try removing or deactivating the plugins. In case it is an outdated plugin, update it to the latest version or discard it.

In conclusion, you’ve to test each plugin and find the faulty one.

But if WordPress keeps logging out and makes it impossible to access the Plugins Dashboard, you can manually deactivate the plugins using the FTP client.

Log in to your WordPress directory, navigate to the wp-content folder and look for the plugins folder.

WordPress FTP client

Next, rename the folder as “plugins_old” to deactivate all your plugins.

Now, log in to the WordPress website and test each plugin manually.

6. Clear Your WordPress Site’s Cache

WordPress caching enhances the performance and speed of your website. It loads the static cached files faster and reduces the load from your hosting servers. Thus, improving the overall user experience.

Well, it sure does wonders for you, but it can also cause problems for your WordPress website, such as loading older versions of your website or creating complications to trigger the WordPress logged out issue.

If you are using a cache plugin, simply clear your cache, and the issues will resolve. Refer to the plugin’s documentation for more information.

Clearing WordPress cache is also specific to the website hosting service in use. However, it usually takes a few clicks.

You can also clear the WordPress cache manually using the FTP server or CPanel file explorer. You will have to access your website’s root directory and locate the ‘wp-content/cache’ folder. The ‘cache’ folder contains all the website cache.

So, clear this folder and easily delete the site cache. It is the simplest method to rid yourself of the “WordPress keeps logging out” issue.

7. Restore the Default Theme

Does WordPress keep logging out still? It might be due to a poorly-coded theme.

As WordPress is open-source software, developers can contribute to a poor-quality theme. You may apply such themes to your store by mistake or without proper testing. Down the line, it causes many problems, including frequent WordPress logout.

By default, WordPress has a pre-installed Twenty Twenty-Two theme. So you can easily check and resolve a theme conflict by applying back the default theme. If the site goes to normal, then you can confirm the new theme was causing the logging out the issue.

To switch themes, follow these steps:

  • Go to Appearance > Themes from the Admin panel.

select wordpress themes

  • It will show all available themes (Download and the Current theme).
  • Activate the Twenty Twenty-Two theme to implement it.

If you have previously deleted the default theme, then type in the search bar “Twenty Twenty-Two”, download, and activate it. Then, log into your WordPress website again to see if the problem is gone.

To avoid unnecessary theme conflicts, please get a custom theme that is tailored for your business. Or you can select the high-quality theme available on WordPress.

Surefire WordPress Theme Selection Tips for 2022

Implement perfect themes on your WordPress website to maximize user engagement.

8. Get Professional Help if WordPress Is Still Getting Logged Out

If you have tried all the above-mentioned methods and still WordPress keeps logging out, then you need experts on board that have the technical knowledge to resolve such issues.

Setting up and running a WordPress website is a complex process and you might not know everything about it. Website owners outsource content and graphics all the time. So, seeking professional help is not an outlandish theory.

This is especially important if you have a business website, the WordPress logging out issue can cause serious harm to your profits.

You don’t have to go too far to search for a reliable WordPress agency.

We have got you covered.

WP Swings is one of the leading WordPress/WooCommerce agencies. We have a team of highly-experienced WordPress experts who have developed numerous stores, plugins, themes, websites, native mobile apps, and more.

We have 50+ plugins distributed over different platforms such as Envato, WordPress.org, and WooCommerce.

Also, we provide tailored services to build API integrations, manage security and site maintenance, backup and migration, and fix WordPress/WooCommerce issues.

So take your time and learn more about us.

But I assure you, if nothing works, then WP Swings is the solution you need.

WP Swings WordPress Services

The only complete solution to fix all your WordPress/WooCommerce issues.

Wrapping Up

Getting logged out of your WordPress dashboard is a sore experience. The looming fear of losing everything you’ve worked on for years. Well stressing over it is understandable but it won’t fix the problem.

Please try the solutions mentioned in this article to stop your WordPress from logging out. Clearing the browser cookies and caches, reverting your WordPress theme, deactivating plugins, etc., are some of the easier solutions.

I’ve also explained ways to fix the login issue via FTP client if you can’t access some parts of your WordPress website.

If all methods fail, then we have got your back. So, you can connect with us anytime.

WP Swings team will review your website, identify the problem and fix it, ensuring minimum inconvenience to you and your users.

Do you have any questions regarding why WordPress keeps logging you out? If yes, then feel free to comment below and I’ll definitely address each of you.

And hey, check out our blogs if you want to learn more about best eCommerce practices.

About the Author: Aditya Srivastava

Aditya Srivastava is a poet, writer, and avid reader. He lives to write and writes for a living. Coffee is his elixir, and books are his best friends. To him, passion and profession are equal. Like most writers, he is also a potent thinker, but he only thinks with his pen.
Search Post
Get exclusive tips, articles, updates, and more.
Subscribe Now
Recent Post
Got A Project! Let's Discuss!
Thank you for your submission. We'll review your request and get back to you.
There was an error trying to send your message. Please try again later.

Related Posts

  • Are you looking for some of the best digital wallet […]

    Continue reading
  • In today’s bustling eCommerce environment, businesses are constantly seeking ways […]

    Continue reading
  • WooCommerce Shipping costs can be a double-edged sword for eCommerce […]

    Continue reading
  • In eCommerce, efficiency and professionalism in managing transactions are key […]

    Continue reading

One Comment

  1. Adam Muiz November 25, 2022 at 11:05 pm - Reply

    I have trouble to login, it because all in one wp security plugin.
    So i deactive it from ftp, then delete it.

    Thank you

Leave A Comment

Subscribe to our blog, receive the best tips, and stay on top of your WordPress game.

Thank you for signing up. You will be the first to know about everything, Stay tuned!
There was an error trying to send your message. Please try again later.