How can I receive an email or SMS notification when something changes on my WordPress site?

You are here:
Back to KB search

Use the SMS & Email Notifications feature in the WP Security Audit Log plugin to receive an email or SMS notification when a specific change happens on your WordPress sites and multisite networks. The concept of configuring a SMS and / or email notifications is very simply: configure the criteria and when an event in the activity log matches the criteria the notification is sent.

This document explains how to configure an email and or SMS notification trigger in just two steps.

1. Find the Event ID of the WordPress Change

The WP Security Audit Log plugin uses a different event ID for the different changes or user actions in WordPress. For example whenever a user logs in, the ID of the event in the WordPress activity log is 1000. Use the search in the list of WordPress activity log alert IDs to find the ID of the change you’d like to be notified about.

In this example we will configure an email and SMS notification for when a user with the Editor role publishes a post. The first thing we need to do is to find the ID of the event that the plugin logs when a user publishes a post. I searched for the term publish in the list of event IDs and can see that it is 2001.

Searching for a specific WordPress activity log alert ID

2. Create the Notification Trigger

Adding a new email & SMS notification

Now that we know the event ID we just have to create the notification trigger seen in the above screenshot. To create it:

  1. Click on the Notifications node in the plugin menu,
  2. Click the Custom Notifications taband click the Add New button.
  3. Specify a title for the trigger. In our example we are using Editor published content.
  4. Click the + Add Trigger button.
  5. Configure the following criterion: EVENT ID IS EQUAL 2001.

Note: if you configure the above trigger only the plugin will send an email whenever a new post is published, though we want to receive a notification when an editor publishes a post, so we have to configure another criterion in the trigger.

  1. Click the +Add Trigger button to add the second criterion.
  2. Configure the following: AND USER ROLE IS EQUAL EDITOR.
  3. Specify the email address(es) and mobile number(s) you’d like to alert and click Add Notification to save the trigger.

Note: to send SMS messages integrate the plugin with Twilio.

More advanced trigger criteria

You can use more trigger types to build more complex criteria. For example you want to be alerted via email or receive a SMS when an editor publishes a post that has the movie custom post type. In such case you can built a trigger such as the below:

ALERT CODE IS EQUAL 2001 AND USER ROLE IS EQUAL EDITOR AND POST TYPE IS EQUAL Movie

You can read more about grouping email notification triggers & using operands in the Getting started guide for WordPress email notifications.