How to capture the last login date and time of users

Prem Tiwari - - WordPress Snippets


If you want to display the last login date and time of the registered user in your WordPress site, then keep your close attention in this tutorial as I am going to share how to capture the last login date and time of user using simple code snippet.

If you have not the coding knowledge, then you can use the User Last Login (https://wordpress.org/plugins/user-last-login) WordPress plugins as well.

How to Capture users last login date and time

Copy the below WordPress code snippets and use it at the end of the wp-content/your-theme-folder/functions.php file and save it.


About: Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.