How to check user login history in WordPress

WordPress user login history is a log that records all logins for individual user accounts on your WordPress site. It includes the date, time, and location of each login. The main purpose is to track user activity, monitor access, and gain insights into login patterns and potential security threats.
In this article, we’ll show you how to check your users’ login history in WordPress using the activity log. We’ll cover two methods that don’t require custom code, using Users Insights and WordPress to track login history.
If you have a WordPress site, you should be keeping an eye on your user login history. Sometimes, it’s hard to determine the user login history if you have many users on your site. That’s because this will help you see how engaging your site’s content is. Knowing your users’ visit patterns will help you filter the most active users.
WordPress user visit tracking data

In such cases, you need a tool to review your WordPress activity log and track your users’ logins. This WordPress tutorial will show you how.

WordPress user login history is a log that records all logins for individual user accounts on your WordPress site.

Technically, setting up a full user activity log of all your users’ actions (like failed login attempts and error log monitor) is certainly possible, but this type of setup is usually used for WordPress security reasons, and it can slow down your site and make your user experience worse. That’s why we opt for a lightweight log for your registered WordPress users with the help of a WordPress plugin. This way, you’ll still be able to monitor user activity and learn basic information about your user logins without affecting your WordPress site performance.

Checking the WordPress login history of your users

Once you install Users Insights, it will automatically track your user logins. So, data such as last login and number of sessions will be available by default in your WordPress activity log.

Filtering your users by user’s last login date is a quick way to see which users have recently visited your site. You can use it to filter active or inactive users. If, for example, you want a report of all users who visited your site in the last month, you can use this filter:

Registered users who visited the site in the last 30 days

As you may notice, this filter won’t give you a number of visits. Therefore, it can only be used to manipulate users based on their last login, not the total number of times they have visited your site.

Another idea is to use the reverse filter and check all users who haven’t been active in the past 30 days. This way, you can contact them or send them something interesting that has happened lately.

Registered users who haven't visited the site

You can break down your WordPress user login by any other metric you like. For example, you may want to check among your top commenters, which ones have logged in recently:

Recent visitors ranked by comments count

Monitor WordPress user activity with user activity log (WordPress last login report)

The Activity module in Users Insights features a Last Seen report, which serves as a WordPress login log, showing how many users last logged into your site during specific time periods. This report tracks user logins over various intervals, such as Today, the Last 7 days, the Last 30 days, and the Last 12 months. This WordPress history log is a valuable tool for understanding user engagement and spotting trends in user activity.

 

How to track user logins through sessions

Another metric that Users Insights tracks is the number of sessions. The session information is going to give you a broader view of your user activity. This field gives you the total number of times a user has logged in. In this way, you’ll know not just when they were last active but how many times they have visited your site in the past.

The basic usage of the sessions field is ordering users by the number of sessions. You can also filter out users by the number of sessions:

 

Registered users sessions log

Just like the last seen filter, the sessions can be used in combination with other filters. In this way, you’ll see how specific user groups behave. For example, you may check among your users with the most posts, and filter only the ones with a high number of sessions.

Most active users ranked by posts count

The sessions are the most important data to look at if you want to log your users’ visits. That’s because the session is storing past data, and if you collect it correctly, you can use it for user activity tracking and notice the change by over time. But how can you do that? Let’s see two different ways in the following sections.

 

Gathering WordPress user login history with segments and user groups

Users Insights has a new feature called segments. This feature is great for tasks like these, where you need to use the same filter over and over, and collect your results.

So you can save the last seen, sessions and any other filters you like as a segment:

Adding recent and active users to a group

Therefore, the segments allow you to easily perform the exact user searches. But now you need a way to store this information. For instance, you may want to check how your users’ sessions change. You can do that by dividing your users into groups, using any criteria you want, for example:

  • Recent logins: Last seen is less than 10 days ago
  • New and active: Date registered is less than 30 days ago + Sessions is bigger than 10
  • Slipping away: Last seen is more than 90 days ago

You can freely change the names, filters, and anything you want in these segments. Then you add your users to their groups, filtering them by the criteria we’ve selected before in our segments:

Addign recent and active users to a group

Now you have this information stored as a group. You can use this next time you want to check if any user has moved away from a group. Search all users from that group who don’t match the group’s criteria anymore. For instance, a user from the “Slipping away” group who visited your site recently.

Users from slipping away who are also recent

And based on that user history information, you can take action. You can, for example, get in touch with them by sending an offer for being such active users.

Now, let’s see some ideas for extending this even further and creating your own user login statistics right from the WordPress dashboard.

 

How to check visited page user history

In addition to WordPress login history data, you can check your users’ visited pages. This creates a WordPress user history that you can use in your analytics.

In order to do that we need to activate the visit tracking module. It is set under Users Insights > Modules. Then you have some settings regarding the user roles that you want to track:

WordPress page visit tracking select user role

 

Furthermore, it’s possible to set up which post types you want to track. Sometimes we just need information in our store, for example, then it makes no sense to track other types:

WordPress page visit tracking select post type

 

Then a great addition to your WordPress user log is their visited pages. We have two sections to check WordPress history of visited pages. The first option is simply to filter all users who have visited a specific page. For instance, if you have a Gold Plan Subscription and want to check all visitors for that page, you can do it here:

WordPress filter users by visited pages

 

This filter is useful for measuring the popularity of a page among your user base. In our case, 36 out of 126 users saw that page. Hence, in addition to a simple user login history, this is an option for measuring your marketing results.

In addition, the opposite filter is helpful as well. It’s possible to filter users who haven’t visited a page. Then you can contact users who haven’t visited essential pages. This is done with the has not visited filter:

WordPress filter users by not visited pages
This filter is useful to check user actions as well. For example, it’s possible to check users who have visited your product but haven’t bought it. Then you can get in touch with offers if you want:

WordPress combine page views filters
Furthermore, it’s possible to check your WordPress user history in their user profile. The activity panel shows last visited pages and most visited pages. This gives you a quick overview of your WordPress user history log.

WordPress user visit tracking data

 

These are just the main pages. The full list can still be seen if you click the “view all” button, which shows the full WordPress user log.

Creating custom WordPress user login statistics

Once you’ve gathered the basic information about your users, you can create metrics and expand your understanding about them. The exact metrics depend on your use cases, but let’s see some ideas.

We can export all the users so we can have some data to work with. You can do that with no filters applied so you can have all the user data:

Exporting all WordPress registered users

Once exported, you can import them to your favorite spreadsheet tool (such as Google Spreadsheets or Excel). Then you can create new columns for your desired stats.

Conclusion

Today we looked into different methods for reporting your user login data. We showed how to check WordPress history and how this information can be used in different situations, like improving user management, monitoring users for WordPress security reasons, or tracking user engagement. By the end of the day, you should be able to collect data as simple as the last activity and as complex as a detailed login history for all your users.

We hope you enjoyed this article and see you again next time!