WordPress new user notifications on your phone.

Get a push notification when a new user account is created on your WordPress site, with their role, so an unexpected administrator stands out.

user.registeredWebsitesSecurity
How it works

Three steps to your first push

STEP 01

Install the recipe

One click in Studio gives you a personal webhook URL.

STEP 02

Paste your URL into WordPress

Add it as a webhook for New user registration.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the WordPress new user registration webhook

  1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
  2. Copy the PHP snippet from the setup notes below. It already contains your endpoint URL.
  3. Save it as a new .php file in wp-content/mu-plugins/ on your site (create the folder if it doesn't exist).
  4. WordPress loads it automatically. Trigger a New user registration to test.
  5. WordPress doesn't send webhooks by itself, so this recipe comes with a small **must-use plugin**. Save the code below as `wp-content/mu-plugins/justpush-new-user.php` (create the `mu-plugins` folder if it doesn't exist). WordPress loads files there automatically; there's nothing to activate.
  6. ```php
  7. <?php
  8. /**
  9. Plugin Name: JustPush — New user
  10. Description: Sends a push through JustPush Studio when a user account is created.
  11. */
  12. // Priority 100 so the user's role is set by the time this runs.
  13. add_action('user_register', function ($user_id) {
  14. $user = get_userdata($user_id);
  15. if (!$user) {
  16. return;
  17. }
  18. wp_remote_post('your webhook URL', array(https://••••••••/•••••••• your personal URL, shown after install
  19. 'blocking' => false, // don't slow the page down waiting for JustPush
  20. 'timeout' => 3,
  21. 'headers' => array('Content-Type' => 'application/json'),
  22. 'body' => wp_json_encode(array(
  23. 'event' => 'user.registered',
  24. 'site' => get_bloginfo('name'),
  25. 'name' => $user->display_name,
  26. 'email' => $user->user_email,
  27. 'roles' => array_values($user->roles),
  28. 'url' => admin_url('user-edit.php?user_id=' . $user_id),
  29. )),
  30. ));
  31. }, 100, 1);
  32. ```
  33. To stop the notifications, delete the file.
The code

What runs when the webhook arrives

Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.

transform.js
1// WordPress → new user registration
2// Fires when the "JustPush — New user" mu-plugin (see INSTALL.md) reports a
3// "user.registered" event. WordPress has no webhooks of its own, so the snippet sends them.
4
5// The snippet sends plain strings; treat blanks as missing.
6function text(value) {
7 return typeof value === "string" && value.trim() ? value.trim() : null
8}
9
10// Only link to real http(s) URLs.
11function link(url, cta) {
12 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
13}
14
15function handleRequest(request) {
16 const event = request.body
17
18 // Guard: only handle this recipe's event, so other snippets on this integration stay quiet.
19 if (event?.event !== "user.registered") {
20 console.log(`Ignoring WordPress event "${event?.event ?? "unknown"}"`)
21 return null
22 }
23
24 const roles = Array.isArray(event.roles) ? event.roles.filter((role) => typeof role === "string") : []
25 // A new administrator you didn't create is a classic sign of a compromised site.
26 const admin = roles.includes("administrator")
27 const who = text(event.name) ?? text(event.email) ?? "Someone"
28 const email = text(event.email) && text(event.email) !== who ? ` (${text(event.email)})` : ""
29
30 return {
31 title: admin ? "🛡️ New administrator account" : "👤 New user",
32 message: `${who}${email} joined` + (roles.length ? ` as ${roles.join(", ")}` : ""),
33 topic: "WordPress",
34 priority: admin ? 1 : -1, // High for admins, Low for everyone else
35 buttons: link(event.url, "View user"),
36 }
37}
Payload

The WordPress user.registered webhook

This is what WordPress sends to your URL for new user registration. It is a sample, trimmed to the fields recipes use.

user.registered · sample.json
1{
2 "url": "https://example.com/wp-admin/user-edit.php?user_id=42",
3 "name": "Sam Lee",
4 "site": "My Site",
5 "email": "[email protected]",
6 "event": "user.registered",
7 "roles": [
8 "subscriber"
9 ]
10}
FAQ

WordPress new user notifications: questions

Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into WordPress and you are done. The code is there if you want to change the text, the sound or the buttons.

Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.

Ready when you are

WordPress on your phone in two minutes.

Install the recipe, paste one URL, done. Free for 30 days, no credit card required.