What's WP
Our everything is about WordPress - best choice of WordPress users!
How to Automatically Log Out Inactive Users in WordPress

How to Automatically Log Out Inactive Users in WordPress

Inactive user, also called idle user, refers to someone behaving inactively on your site and living in idleness. Users who wander on the login page for a long time or stand still on your WP admin to do noting should be regarded as the inactive. In some cases, those users may forget their login information and have to stop to think for a while. Perhaps, that can be some hackers intending to attack your site and take time to watch for their chance.

For the sake of website security, you should prevent any inactive users from logging in with an effective method. Fortunately, WP Idle Logout plugin is just about it. This plugin is designed for automatic sign out for inactivity and that helps you reach the target with a few clicks. Besides, it has won great reputation in the industry thanks to the high level of usability and rich features.

Automatically Log Out Inactive Users with Plugin

Having WP Idle Logout plugin installed and activated an item called Idle Logout is shown under Settings. Go to Settings > Idle Logout and get started to set WP Idle Logout options to make this plugin work for your website properly.

Settings Idle Logout

There are two options available for users, including Idle Time and Idle Message. Even for beginners, they are able to complete all settings only with a few clicks.

WP Idle Logout Options

Idle Time is where to set how long inactive users can stay on your site before being logged out and that should be in seconds. For example, if you set the idle time as 30 seconds, users are allowed to be idle for 30 seconds and then automatically be logged out. The Idle time can be any duration as you will.

Move to Idle Message and that is the message sent to idle users when they are automatically logged out. By default, the message is “You have been logged out due to inactivity”. You can just leave the default message and save changes, or override it for a customizable one. For instance, the notice said “You have been logged out. Thank you for visiting the site” is a good option for you.

Finally, click “Save Changes” to confirm all information and test if WP Idle Logout plugin works for your site smoothly. Log out your WP admin and then open the login page in another browser. Leave it for a while and then a message said “You have been logged out due to inactivity” appears on login box.

Idle Users Logout Example

Even for login users, they are probably logged out once hesitating too much time on the website backend. Since users behave nothing on the admin, a popup said “Session expired” ask them to log in again and redirect them to the login page automatically. That should be like the following screenshot.

Session Expired Notice

Redirect Log Out Users to Homepage

If you want to redirect logout users to homepage instead leaving them on the login page, then you should enable automatic redirection for logout user by means of WordPress plugin. The selected option is jonimo Simple Redirect and that is used to redirect users to anywhere on your site when they log in or log out.

Access to WP admin and install this plugin upon activation. Since everything gets ready, an item called Redirect Settings appears on the sidebar, which further includes several options.

Install jonimo Simple Redirect

Go to Redirect Settings > Logout, and this is where to redirect all users on logout. Four options are available for you to redirect logout users to an internal & external link, a page, a category or a tag. Since we plan to redirect those users to homepage, we are going to target the second option and select homepage. Click “Save Options” to confirm all changes.

Redirect Logout Users to Homepage

Besides logout user redirection, this plugin also enables you to redirect login users to a certain web page. If the selected plugin cannot satisfy your needs, some other options are also great for logout user redirection, such as WPi Custom Logout, Logout Redirect, Siris Login/Logout Redirect and so on.

Author

Lucy has been a very experienced SEOer, technical writer, web developer, c# developer since 2002. Now she owns a startup in San Francisco, CA, focusing on running a couple of blogs to share knowledge and experience with global readers and deliver exceptional results to global sponsors by leveraging the power of Internet.

Close

Want to Learn More About WordPress?

Get Our Free Themes, Plugins, Support, SEO Tips, and Other Tutorials!

Email *