... Skip to main content

How to fix WordPress logging out

By 14/11/2019January 5th, 2023No Comments

Last Updated on 05/01/2023 by iwebsitez.com

If you have the frustrating WordPress problem that keeps logging you out and not any troubleshooting tip like deactivating plugins, clearing the browser cache and cookies works, then we have a fix for you.

In this article, we will explain and show you how to fix WordPress logging out in few easy steps.


Why WordPress keeps logging you out?

The WordPress login process sets a cookie directly int your desired browser as a form of authenticating session and if you’re trying to access WordPress with a different login URL already set in your backend settings then WordPress will not authenticate your login session.

Fix in WordPress dashboard

Now that we have understood how WordPress login process works we will give you a simple fix to apply in WordPress dashboard >> Settings >> General.
Once in you’re in WordPress General settings, the first thing to look at is if the two URL’s in WordPress Address (URL) and Site Address (URL) are the same. You have to make sure they are both the same URLs.

Fix in wp-config.php file

In case you cannot in any way access the backend dashboard then you want to apply some manual code in the wp-admin.php file.
To access this file you need to connect your website to an FTP client (file transfer protocol) and search the site’s root directory to find the wp-admin.php file. Once located, you want to download it to your desktop and open it with a text editor such as EditPlus 3 or Notepad, above the line copy and paste this code making sure the two URL’s are the same with or without www :

Simply add this code to your theme’s functions.php file, preferably your child theme:

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

Just replace example.com with your domain name.

Job done!

Don’t forget to swap our details for yours. So there you have it, an easy way to add a custom widget in a WordPress dashboard, please check our other WordPress fixes and our WordPress maintenance page for care plans.

Need a price for a new website instantly

Try our website cost calculator for free and get a price emailed to you.

Leave a Reply