WordPress

Monitor your WordPress site events (logins, registrations, errors, etc.) directly in AlertHub. The official AlertHub plugin lets you configure alerts for any WordPress hook without writing code.

Installation

Install AlertHub from the WordPress.org plugin directory.

  1. Log in to your WordPress Admin Dashboard.
  2. Go to Plugins > Add New.
  3. Search for AlertHub.
  4. Click Install Now, then Activate.

You can also open the plugin page directly: wordpress.org/plugins/alerthub.

Alternative: WP-CLI

wp plugin install alerthub --activate

Configuration

Once activated, you need to connect the plugin to your AlertHub project.

  1. Get your Project Key:

  2. Enter Credentials:

    • In your WordPress Dashboard, go to Tools > AlertHub.
    • Paste your Project Key in the corresponding field.
    • (Optional) Set a Shared Source Name (e.g., “My Blog”). This helps identify alerts if you manage multiple sites.
    • Click Save Settings.
  3. Test the Connection:

    • Click the Send Test Alert button.
    • Check your AlertHub dashboard (and any connected channels like Slack/Teams) to confirm you received the test alert.

Creating Alerts

You can create custom alerts for any WordPress action hook.

  1. Go to Tools > AlertHub > Alerts.
  2. Click Add New.
  3. Active: Ensure the alert is enabled.
  4. WordPress Hook: Select a preset (e.g., wp_login_failed, user_register) or type any valid WordPress hook name (e.g., woocommerce_payment_complete).
  5. Title & Description: Define what the alert should say. You can use valid placeholders if the hook passes arguments (advanced usage).
  6. Level: Choose between Info, Warning, or Error.
  7. Click Save Alert.

Advanced: Using Placeholders

You can use dynamic data from the WordPress hook in your alert title and description using {{mustache}} syntax. The placeholder {{0}} access the first argument passed by the hook, {{1}} the second, and so on. You can also access object properties like {{1.post_title}}.

Example: Failed Login Alert

When a login fails, WordPress triggers the wp_login_failed hook, passing the username as the first argument that means the placeholder {{0}} will be the username.

  • Hook: wp_login_failed
  • Title: Failed Login: {{0}}
  • Description: Someone tried to log in as **{{0}}** but failed.
  • Level: Warning

This will result in an alert like: “Failed Login: admin”.

You can check the complete list of WordPress hooks and the arguments they pass to understand how to use placeholders.

Logs

The plugin keeps a local history of sent alerts for debugging purposes.

  • Go to Tools > AlertHub > History.
  • You can see the status, payload, and response of the last alerts sent.