WordPress User last login date

WordPress user last login

WP Last Login

WordPress user last login date is important attribute, useful for the health of your site. Why it could be necessary? Did you configure your WordPress site opened to new user registration? If “Yes”, then you know definitely about spam user registrations. Yes, there are special plugins to fight with this serious problem. But even excellent automatic defence can be overcome somehow, and except of tens of thousands spam registrations you will have 5-10 registrations a day, 300 – a month, 3600 a year… Is there a need to continue? Thus, in order to cleanup your site database, remove such overload it is needed to analyse your site users, at least from time to time.

Some user email addresses say itself that those are the SPAM email addresses. For example, you may see some product names or the set of keywords at email address, like “thebestcheapswissclocks@hotmail.com”. Did you meet something similar at your blog? Such user should be deleted without any doubts. But what to do with others?

WordPress user last login date will help you

This attribute could help you to decide if it is a real user or it is not? If user never login to your site, then what’s the reason to store his record at WordPress database, to be more exact, thousands of records. WordPress doesn’t have built in functionality to trace last user login date. But, thanks to wisdom of its developers, WordPress is widely extensible platform. It has a lot of hooks, actions and filters in order to closely interact with WordPress core code and events inside it. Thus, as usual, if we have not some feature at WordPress itself, we can find plugin, which make what do you need, or to hire some PHP WordPress plugins developer, like me to realize your brilliant idea.

Are there plugins to add WordPress user last login date attribute to your site users list? Yes, there are. Go to ChoosePlugin.com, press the “Search” button, input ‘last login’ keywords into plugin title field at opened dialog window and get the list of suitable plugins.

I checked one of them – “WP Last Login”. It allows to store and see date and time of last login for any registered user. It has no its own menu item and settings page, as it has no any parameters. It just store WordPress user last login date for any user at user_meta database table and show that data at WordPress users list as additional column. So having such plugin installed and activated you will get information needed to analyse your users list and decide what record you need to delete.

What I missed at such plugin that a feature to bulk delete SPAM registered or definitely inactive users automatically by criteria, e.g. last login more then a year ago, etc. What do you think? Will such feature be useful?

  • ryanbayne

    Nice post. Helps to clear up my question.

    Currently creating a plugin for using on http://www.webtechglobal.co.uk which automatically deals with spam registrations already in the database and cleans up minor subscribers i.e. those who post once and never return for years. Those guys could be dead right, sorry but its true.

    So I was wondering, my question is, does WP already store the last time a user logged in? Surprised that there is no user value for this and I think WordPress should even record some user history but make it optional.

    My plugin will check the users account on phpBB which is bridged from WordPress, just to make sure they don’t just simply hang out on the forum.