WP Toolkit Custom Events

Last modified: 2026 February 12


Overview

WP Toolkit can run custom scripts after it completes specific actions. This allows you to automate tasks for WordPress instances.

Enable event hooks

To use hooks for custom events, enable the feature in the WP Toolkit configuration file. Add the following option to the /usr/local/cpanel/3rdparty/wp-toolkit/var/etc/config.ini file:

exposeEventsFeature = true

The usr/local/cpanel/3rdparty/wp-toolkit/var/user-hooks directory contains the custom scripts WP Toolkit runs after supported actions.

Use the correct filename for the action that you want to automate. You can only run one script per action.

Supported actions and their hooks

If present in the usr/local/cpanel/3rdparty/wp-toolkit/var/user-hooks directory, WP Toolkit runs the following scripts after it completes the corresponding action.

Action Description
Site installation completed The ./site-installation-completed script runs after WP Toolkit installs and configures a WordPress site.
Arguments:
  • --instance-id=1
  • /absolute/path/to/wordpress
Plugin installation completed The ./plugin-installation-completed script runs after WP Toolkit installs a plugin (including plugins installed via sets).
Arguments:
  • --instance-id=1
  • --plugin-slug=slug
  • /absolute/path/to/wordpress
Theme installation completed The ./theme-installation-completed script runs after WP Toolkit installs a theme (including themes installed via sets).
Arguments:
  • --instance-id=1
  • --theme-slug=slug
  • /absolute/path/to/wordpress
Set installation completed The ./set-installation-completed script runs after WP Toolkit installs a set.
Arguments:
  • --instance-id=1
  • --set-id=1
  • /absolute/path/to/wordpress
Vulnerability check completed The ./vulnerability-check-completed script runs after WP Toolkit finishes scanning for vulnerabilities.
Arguments:
  • --instance-id=1
  • --old-vulnerabilities=1,2
  • --new-vulnerabilities=3,4
  • /absolute/path/to/wordpress
Site cloning completed The ./site-cloning-completed script runs after WP Toolkit completes site cloning.
Arguments:
  • --source-instance-id=1
  • --source-site-path=/absolute/path/to/wordpress
  • --target-instance-id=2
  • --target-site-path=/absolute/path/to/wordpress
Site syncing completed The ./site-syncing-completed script runs after WP Toolkit finishes copying data between sites.
Arguments:
  • --source-instance-id=1
  • --source-site-path=/absolute/path/to/wordpress
  • --target-instance-id=2
  • --target-site-path=/absolute/path/to/wordpress
WordPress core updated The ./site-core-updated script runs after WP Toolkit updates WordPress core.
Arguments:
  • --instance-id=1
  • --old-version=1
  • --new-version=2
  • --site-path=/absolute/path/to/wordpress
Plugin update completed The ./site-plugin-updated script runs after WP Toolkit updates a plugin.
Arguments:
  • --instance-id=1
  • --slug=plugin-slug
  • --old-version=1
  • --new-version=2
  • --site-path=/absolute/path/to/wordpress
Theme update completed The ./site-theme-updated script runs after WP Toolkit updates a theme.
Arguments:
  • --instance-id=1
  • --slug=theme-slug
  • --old-version=1
  • --new-version=2
  • --site-path=/absolute/path/to/wordpress

Additional Documentation