How to Track User Login detail in WordPress – A User Login History WordPress Plugin Tutorial

user login history

Monitoring WordPress User Login History – Why?

Do you know how many users do login on your WordPress website? From where are they doing login and how long do they remain active on your site? Do you want to target your visitor by knowing their geographic locations? Unfortunately, WordPress by default does not provide all these above functionalities. To track these activities, you must either develop your own plugin or use third party plugin.

Through this post I would like to let you know about my free WordPress plugin i.e. User Login History which can help you to track all such activities.

Here are a few reasons for tracking WordPress user login activity can help your site:

Security. If someone does log into your website from two or more different location in very short interval of time, you can take needful steps e.g. temporarily you can block such user’s account to prevent miss use of their account.

Analytics. With help of the tracked data i.e. login time, ip address, browser etc., you can easily decide how and where to spend time and money for your campaign advertisement. This can also help you to generate a good lead and to improve sales.

Time Tracking. If you are running a WordPress website for your employees and you want to track their timings and locations based on IP address, this plugin will be the best one for your need.

I hope that I have convinced you to track all your users’ login activity and now I am going to show you how to do it exactly through my plugin.

How to get User Login Details just after login?

User Login History WordPress Plugin lets you track many attributes of users while they do login.

Here is the list of all the attributes which can be tracked through the plugin:

  1. Login Time
  2. Logout Time
  3. Last Seen Time
  4. Session Duration: How long user remains active on website.
  5. User ID
  6. Username
  7. IP Address
  8. Browser
  9. Operating System
  10. Current Role
  11. Old Role – the role while user gets loggedin
  12. Country Name
  13. Country Code
  14. Time zone

Sounds good. Here’s how to use it:

Step 1: Installation

Since this plugin is free and hosted on WordPress.org directory, you should be able to install it directly from your WordPress dashboard:
user loging history install

Step 2: Configuration

Once you’ve activated the plugin, you’ll get a new User Login History tab in main menu of your dashboard sidebar and a new tab under settings menu. You can configure the plugin by going to Settings → User Login History.

User Login History Settings
In the Backend Options tab, you can configure time zone that will be used to show date-time on listing table in backend.

User Login History Settings 2

In Frontend Options tab, there are two settings:
Columns: You can select the columns that you want to show on frontend listing table.
Pagination:  You can enter number records that you want to show on frontend listing table.

Step 3: View login history of all the users in admin panel

Go to Dashboard–>User Login History:
User Login History Listing
If you need to filter the listing table, you can use the search form.
If you want to manage the columns and pagination for the listing table, you can use screen options given on top right side.
User Login History Screen Option

Step 4: View login history of current loggedin user on frontend

To see the records of current loggedin user in frontend, you can use the following short-code either in your template file or in page.
For template file, use this following code:

For page, use this following shortcode in description area:
[user-login-history]
 user login history shortcode

Now visit the page on frontend.

 user login history Frontend listing

So, this is the end of tutorial and I hope that I explained it very well.
If you have any query, feel free to ask. You can comment on the post.

DOWNLOAD – User Login History WordPress Plugin

LIVE DEMO- User Login History WordPress Plugin

Thanks for reading the post.


About Faiyaz Alam

Leave a Reply