WordPress Plugins
Free Tools
Pricing Blog Case Studies Switch to Royal Plugin Graveyard Support My Account Cart
Support / GuardPress / Sign-In Notifications Setup

Sign-In Notifications: Email Users When Their Account Signs In

GuardPress can email a user a Gmail-style “New sign-in to your account” notification every time their account successfully signs in. The recipient is the user themselves, not the site admin — the same pattern Gmail, GitHub, and every major SaaS uses. If a user’s account is compromised, the unfamiliar sign-in shows up in their own inbox and they can act on it directly. This walkthrough covers what fires when, how to configure the per-role allow-list, what’s in the email, and how the audit log backs it up.

The default is on for Administrators only

Sign-In Notifications ship enabled out of the box, with the role allow-list set to Administrator. If you have a single-admin site, you’re already getting a notification email every time you sign in. If that’s not what you want, jump to Turning notifications off.

What Sign-In Notifications Do

Every time a user successfully signs in on any surface (wp-login.php, WooCommerce /my-account/, MemberPress, custom AJAX login, and anywhere else that fires the WordPress wp_login action), GuardPress checks the user’s role against your configured allow-list. If any of their roles match, one email is sent — not to you, the site admin, but to the user’s own email address on file. Subject line: “[Your Site] New sign-in to your account.”

Why the user and not the admin? Because that’s where compromise detection actually works.

Alongside the email, GuardPress writes an successful_login_notified entry to the audit log with severity info, capturing the user ID, username, IP, and role. This is the belt to the email’s suspenders — if the user’s mailbox is also compromised, the audit log still records the sign-in for you to spot post-hoc.

Sign-in notifications don’t fire on failed logins

Only successful sign-ins trigger a notification. Failed attempts feed the brute-force counter instead (see Brute-Force Protection Setup). If you want to be alerted on suspicious activity around your account, both features working together are the answer — brute-force protection catches the attackers who don’t know the password; sign-in notifications catch the ones who do.

Configuring the Feature

Both settings live at GuardPress → Settings → Login Protection → Login Notifications.

The master toggle

Option name: guardpress_login_notify_enabled. Default: on. The single checkbox labelled “Email users when their account signs in.” When off, no notification emails are sent to anyone regardless of role. The audit-log companion entry is also not written when the master toggle is off.

The per-role allow-list

Option name: guardpress_login_notify_roles. Default: [‘administrator’]. The checkbox grid labelled “Notify users with these roles:” shows every role registered on your WordPress install — Administrator, Editor, Author, Contributor, Subscriber, plus any custom roles from WooCommerce (Shop Manager, Customer), MemberPress, or role-editor plugins.

Only users whose roles intersect the allow-list get notified. If a user has multiple roles (WooCommerce Customer + Administrator, for example), being in any one of the allow-listed roles is enough — the intersection check uses array_intersect. Users whose roles don’t intersect at all are silently skipped — no email, no audit-log entry either (the audit entry only fires when the notification is sent).

Why the default is Administrator only

Admin accounts are the highest-value phishing target on any WordPress site — a compromised subscriber account can post spam; a compromised admin account can install a backdoor plugin and own the site. Notifying admin owners on every sign-in is cheap and high-signal. For a typical business site, this is exactly the right default — you’ll see every sign-in to your own account and none of the noise from thousands of customers signing in to their WooCommerce accounts.

Common configurations

What the User Receives

The email is HTML-formatted and deliberately styled to look like the Gmail / GitHub sign-in notification users already recognise. Subject line: “[Your Site Name] New sign-in to your account.” The body includes:

A few implementation details that matter:

Reading the Audit-Log Companion

Every notification that fires also writes an entry to GuardPress → Audit Log with action = successful_login_notified and severity info. The description reads:

Notify-eligible sign-in by [username] (role: administrator) from [IP]

Why bother? Because email is a single point of failure. If an attacker compromises both the WordPress admin account and the user’s email account (which happens — both often share the same password), they can delete the sign-in notification before you see it. The audit log lives in your database, is only accessible from wp-admin, and is one layer of protection deeper. If you’re investigating a suspected compromise post-hoc:

  1. Open GuardPress → Audit Log and filter for successful_login_notified entries.
  2. Cross-reference IPs against the Sign-In Notifications emails in the user’s inbox. Any audit-log sign-in that didn’t produce an email in the user’s inbox suggests the email was deleted after the fact — a strong signal the email account is also compromised.
  3. Check the IP geolocation against where the user actually was at that timestamp. GuardPress’s audit log stores raw IPs; you can look them up with any reverse-IP or geo-IP service.

The audit log entry only records the fact that a notification-eligible sign-in happened. If you want to see all successful sign-ins including those to roles outside the allow-list, WordPress core’s wp_login action fires for every sign-in regardless. GuardPress’s brute-force module also logs failed sign-ins to gp_failed_logins.

Turning Notifications Off

Two ways, depending on how selective you want to be:

Turn off entirely

Go to GuardPress → Settings → Login Protection

Scroll to the Login Notifications section.

Uncheck “Email users when their account signs in”

Save the settings page. No further sign-in notifications will be sent to anyone, regardless of role. The audit-log companion entry also stops being written — if you want the audit log without the emails, use the per-role method below instead.

Turn off for specific roles only

Leave the master toggle ON

Keep Email users when their account signs in checked.

Uncheck the roles you don’t want notified

In the Notify users with these roles grid, uncheck any role that shouldn’t receive notifications. To disable notifications entirely without turning off the master toggle, uncheck every role — the module treats an empty allow-list as “notify nobody.” The audit log still records the fact that eligibility was checked, but no emails go out.

Save the settings page

Changes take effect on the next sign-in. Users currently signed in aren’t retroactively affected.

Common Mistakes

Adding Customer to the allow-list on a busy WooCommerce store

Customers sign in dozens or hundreds of times a day depending on your traffic. Emailing them all every time is a support-ticket generator, not a security feature. Keep customer accounts on the standard set of protections (brute-force + 2FA opt-in) and leave sign-in notifications for higher-privilege roles.

Assuming the admin gets copies of the emails

The admin does not automatically get a copy. Each user gets their own notification for their own sign-ins. If you want centralised visibility as the admin, use the audit-log filter (above) — that’s the intended channel.

Panicking about your own routine sign-in emails

If you’re the site’s sole admin and the default settings are on, you’re going to get an email every time you sign in. That’s working correctly. Check the IP in the email matches where you were and the timestamp matches when you signed in. If both match, ignore. If either doesn’t, act on the “This wasn’t me” link immediately.

Trusting only the email channel

A sophisticated attacker who owns your WordPress admin account will often also target your email — either because you reuse passwords, or via account recovery flows on the mail provider. The audit log is your defence in depth. Get in the habit of checking GuardPress → Audit Log → successful_login_notified periodically, not just when a suspicious email lands.

Forgetting sign-in notifications don’t block anything

This feature tells you a sign-in happened. It doesn’t block bad ones. For blocking, layer it with 2FA (see Per-Role 2FA Enforcement) and brute-force protection.

Still Stuck? Email Priority Support

If sign-in notifications aren’t behaving as expected — not sending when they should, sending to the wrong recipient, sending too many, showing the wrong IP:

Email support@royalplugins.com with the diagnostic info below. Priority email support is included with your GuardPress Pro license — typical response time is within 24 hours.

Information to include in your email

  • GuardPress version from WP Admin → Plugins (must be 1.6.13 or higher — sign-in notifications shipped in 1.6.13)
  • WordPress version from WP Admin → Updates
  • Whether the master toggle is on at Settings → Login Protection → Login Notifications
  • Which roles are in the allow-list (screenshot of the checkbox grid is fine)
  • The affected user’s role(s) from Users → All Users
  • The user’s email address as configured in WordPress (the notification goes to $user->user_email, not the admin email)
  • Whether an SMTP plugin is active (Royal SMTP, WP Mail SMTP, etc.) — delivery issues are usually SMTP configuration, not the notification module
  • Recent successful_login_notified entries from GuardPress → Audit Log for the affected user — if the audit-log entry fires but no email arrives, it’s an wp_mail() delivery issue on your side, not a GuardPress issue
Related GuardPress topics

Sign-in notifications are the tell-you-something-happened layer. If you want to block: