Skip to content

WP Admin Automations

How to Send an Email When a WordPress Plugin Is Activated or Deactivated

On a site with more than one admin, plugins get switched on and off without anyone telling the rest of the team. Zapify can email you each time a plugin is activated or deactivated, with the plugin's name and who did it. It uses the free A plugin is activated or deactivated trigger and the Send an email action.

What this automation does

The automation is one trigger plus one action:

  • Trigger: A plugin is activated or deactivated (WPADMIN_PLUGIN_STATUS_CHANGED, WP Admin)
  • Action: Send an email (WP_SEND_EMAIL, WordPress)

When a plugin changes state, Zapify emails the address you set with the plugin's name, whether it was activated or deactivated, and the username of the person who did it.

A bulk action on the Plugins screen runs the automation once for each plugin, which is what you want from an audit trail.

Before you start

  • A working email setup on your site.

No other plugin needed

WP Admin is built into Zapify and uses WordPress itself, so there is nothing to install. It is a free integration.

How to build the automation

Step 1: Create a new automation

  1. In the WordPress admin, go to Zapify → Automations.
  2. Click Add New to open the builder.
  3. Name it clearly, such as Tell me when plugins are switched on or off.

Create a new automation

Step 2: Add the "A plugin is activated or deactivated" trigger

  1. Click Add Trigger.
  2. Choose WP Admin as the app.
  3. Select the trigger A plugin is activated or deactivated.
  4. In the Plugin field, pick one plugin, or leave it on Any plugin.
  5. In the Status field, choose Activated, Deactivated, or Activated or deactivated to react to both.

Add a trigger

Select WP Admin as the trigger

Select A plugin is activated or deactivated

Step 3: Add the "Send an email" action

  1. Click Add Action.
  2. Choose WordPress as the app.
  3. Select Send an email.

Add an action

Select WordPress as the action

Select Send an email

Step 4: Write the email

Use the {} token button beside any field to insert the details of the event.

Select the email recipient

Field Required What it does
To Yes Type the address that should get the alert. Separate several addresses with commas.
Subject Yes The subject line. Tokens are allowed.
Format Yes HTML (default) or Plain text.
Body Yes The message. Tokens are allowed.
Cc / Bcc No Extra recipients.
From name / From email No Override the sender.
Reply to No Where replies go.

For example:

  • To: you@example.com
  • Subject: {Plugin name} was {Status} on your site
  • Body: {Actor username} {Status} {Plugin name} (version {Plugin version}).

Complete the Send an Email Action

Step 5: Set the steps Live and save

  1. Set both the trigger and the action to Live. A new automation starts as Draft and will not run until its steps are Live.
  2. Click Save.

Set the automation live

Tokens you can use

Token What it holds
Plugin name The plugin's name, read from the plugin on disk.
Plugin file The plugin's file inside the plugins folder, such as akismet/akismet.php.
Plugin version The version installed now. After an update this is the new version.
Plugin author The author named in the plugin.
Status activated or deactivated.
Network-wide yes or no.
Actor user ID / Actor username The logged-in person who did it. Empty (and 0) when nobody was logged in, as with an automatic update.

How to test it

  1. Open Plugins and deactivate a harmless plugin, then activate it again.
  2. You should get two emails, one for each change.
  3. If nothing arrives, open Zapify → Logs to see whether the run fired.

Conclusion

With the free A plugin is activated or deactivated trigger and the Send an email action, nobody changes your plugins without you knowing. For a stricter alert on one critical plugin, see getting alerted when a security plugin is deactivated. For a permanent record, see logging activations to a Google Sheet.

FAQs

Can I be told only when a plugin is deactivated?

Yes, and it is free. Set the trigger's Status field to Deactivated. Choose Activated to hear only about activations.

Does it say who did it?

Yes. Actor username and Actor user ID hold the logged-in person who made the change. They are empty when nobody was logged in, for example when a plugin is switched off by a command-line tool.

Does it fire when a plugin is updated?

No. WordPress does not report an update as an activation or a deactivation. Use the A plugin is updated trigger for that.

Does it report when Zapify itself is updated?

No. Zapify cannot watch itself being replaced, so its own activation, deactivation and updates are left out. The Plugin dropdown does not list it.

Is this feature free?

Yes. WP Admin is a free Zapify integration, and both the trigger and the Send an email action are included in the free plan.

Why didn't the email arrive?

Open Zapify → Logs. If the run succeeded but no email arrived, the cause is usually the site's mail configuration. An SMTP plugin resolves most delivery problems. Check the spam folder too.

Do I need to write any code?

No. Everything is configured in the Zapify visual builder.

Was this page helpful?