Description
The Limit Active Logins WordPress plugin decides how many devices may stay logged in to the same account, and what happens when someone tries to add one more.
A membership password is shared with a friend. A course login is used in two houses at once. An employee leaves and the browser at their desk is still signed in. You set a limit, for example one device. The next login can be blocked, can replace the oldest session, or can sign out every other session. You can also open the session list and end one yourself.
It uses WordPress’s own session tokens, so it covers any login that goes through normal WordPress authentication: wp-login.php, WooCommerce, membership plugins, and LMS plugins. It also works when sessions are stored in Redis or Memcached.
Setup, the three behaviours, and the session screen are in the official documentation.
How it works
- Open Active Logins Settings. Set the maximum number of devices (1 to 2,500) and choose Block, Allow, or Logout all.
- A member signs in. If they are under the limit, nothing changes. If they are at the limit, the plugin applies the behaviour you chose.
- Open Active Logins to see who is signed in, on which device, and end a session without changing their password.
Administrators are exempt by default, so you cannot lock yourself out while you test. A browser left open and idle gives up its place, so a forgotten tab does not block the next login. Defaults after activation: one device, new logins blocked at the limit. How logins are limited »
Features
- A site-wide device limit: 1 to 2,500 active logins per account. General settings »
- Three behaviours at the limit: Block the new login, Allow it and sign out the oldest session, or Logout all other sessions so only the new device stays in.
- Idle sessions give way: a session unused for longer than the time you set (30 minutes by default, minimum 5) is ended when a new login needs the place. Closing a browser without logging out does not lock the account.
- A reason on the next visit: someone who was signed out sees why, on the login screen.
- Administrators exempt: users who can manage the site are not limited. Leave this on.
- One user, a different limit: on the profile screen, choose the site default, a custom number, or unlimited. Per-user limit »
- Active sessions: user, IP, browser, operating system, device, login time, and last activity. Search by user ID, username, or email, and filter by role. Dashboard »
- End sessions remotely: one session, every session of one user, or every session on the site. Your own admin session stays signed in. Log out all users »
- The real visitor IP: direct connection, Cloudflare, or your own proxy. Forwarded headers are trusted only from addresses you allow, so a forged header is ignored. Visitor IP »
- WP-CLI: list sessions, log a user out, and set a limit from the server, including a way back in if you turned the admin exemption off. Commands »
- Developer hooks: change the limit, the mode, or who is exempt, and react when a login is blocked or a session ends. Hooks »
- Multisite: sessions belong to the network. A site administrator can see and end sessions only for members of their own site.
Documentation
- Introduction
- Installation
- How logins are limited
- Dashboard and active sessions
- General settings
- Visitor IP
- A limit for one user
- WP-CLI
- Developer hooks
- FAQ
- Get support
Source Code
The PHP source of this plugin is readable in the distributed files.
The admin screen is a React application compiled to public/js/lal-admin.js and public/css/lal-admin.css. The compiled files are not minified. React is not bundled: WordPress provides it, which is why WordPress 6.6 or newer is required.
The complete source code and the build configuration are included in this plugin, in the react-src/ directory.
To build the JavaScript and CSS from source:
1. Open the react-src/ directory: cd react-src
2. Install the dependencies: npm install
3. Build: npm run build
The build output is written to public/js/ and public/css/.
External Services
This plugin does not connect to an external service. Sessions and settings are stored in your WordPress database, or in your site’s session storage if you use one, such as Redis.
Developers
Filters
web357_lal_max_active_logins( int $limit, WP_User $user ): change the limit.0means unlimited.web357_lal_login_mode( string $mode, WP_User $user ):block,alloworlogout_all.web357_lal_is_exempt( bool $exempt, WP_User $user ): exempt a user from all limits.web357_lal_client_ip( string $ip ): override the detected visitor IP.web357_lal_cloudflare_ranges( string[] $cidrs ): update the trusted Cloudflare ranges.
Actions
web357_lal_login_blocked( WP_User $user, int $limit ): a login was rejected.web357_lal_session_ended( int $user_id, string $reason, array $session ): the plugin ended a session. Reasons:limit,logout_all,idle,admin.
WP-CLI
wp web357-lal sessions [<user>] [--format=table|json|csv]wp web357-lal logout <user> [--session=<id>]wp web357-lal logout-all [--yes]wp web357-lal limit get <user>-
wp web357-lal limit set <user> <number|unlimited|default>is a user ID, email or username.
Screenshots




Installation
The plugin is simple to install.
From the WordPress dashboard
- Go to Plugins Add New.
- Search for Limit Active Logins by Web357.
- Click Install Now, then Activate.
- Open Active Logins Settings.
Manual upload
- Download
web357-limit-active-logins.zipfrom the product page. - Go to Plugins Add New Upload Plugin, choose the zip, and click Install Now.
- Activate the plugin.
- If the site is behind Cloudflare or a load balancer, set How to detect the IP before you trust the IP column.
People who are already logged in appear in the session table without signing in again. Installation guide.
FAQ
-
What does this plugin do, in one sentence?
-
It limits how many browsers can be logged in to one WordPress account at the same time, and lets you end a session from the admin.
-
What counts as one active login?
-
One logged-in browser. Two browsers on the same computer count as two. Application passwords and XML-RPC are never counted or blocked, because they do not create a browser session. How logins are limited »
-
Does it work with WooCommerce, membership plugins, and LMS plugins?
-
Yes. Any login that uses standard WordPress authentication is covered, including WooCommerce, Tutor LMS, MemberPress, Restrict Content Pro, and SureCart.
-
A customer closed the laptop and now cannot sign in on their phone.
-
They are not stuck. A session idle longer than Idle sessions give way after (30 minutes by default) is ended when the new login needs that place. Lower or raise the minutes under Active Logins Settings. Idle threshold »
-
I locked myself out. How do I get back in?
-
Administrators are exempt unless you turned that off. If you did, from the server run
wp web357-lal limit set <your-username> unlimited, orwp web357-lal logout <your-username>to end the other sessions. Recover from a lockout » -
Every visitor shows the same IP.
-
The site is behind Cloudflare or a proxy, and detection is still set to Direct connection. Switch to Behind Cloudflare or Behind my own proxy / load balancer. The settings screen shows the IP it detected for you. Visitor IP »
-
Does it work with Redis or Memcached?
-
Yes. Sessions are read and ended through whichever session storage WordPress is using.
-
I also use a plugin that limits failed login attempts.
-
When Block mode refuses a login, WordPress reports it as a failed login, so that other plugin may count it. The
web357_lal_login_blockedaction is there so you can tell a limit block apart from a wrong password. Hooks » -
Can one customer have a higher limit than everyone else?
-
Yes. Edit the user and set site default, a custom number, or unlimited. Per-user limit »
-
What is stored, and for how long?
-
Session details (IP, browser, device, last activity) live with WordPress’s own session tokens. Deleting the plugin removes its tables unless you turn on Keep data when the plugin is deleted. User sessions are not changed by uninstall. Privacy »
-
Where is the full documentation?
-
Start here: Limit Active Logins docs. For help, contact support.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Web357 Limit Active Logins” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Web357 Limit Active Logins” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.0
- First release.
