WordPress Auto Logout after Inactivity


Here is a quick way to add an automatic logout feature to your WordPress powered website.  Add this code to your child themes functions.php file.  Don’t know what a child theme is?  Click here.



Put this javascript in a separate file. Note its file path as you will need to enqueue the script later.



Don’t forget to enqueue the script and localize it for the ajax to work.  Do this in your child theme’s functions.php file. You are using one of those right?


~ Layer7web

Comments are closed.