Updated on 18 March, 2025
WP CLI commands for WP Activity Log
WP Activity Log supports a number of WP CLI commands, which can be used to configure various aspects of the plugin. These commands make it much easier to configure the plugin on a large number of websites.
We will be releasing a number of new commands with every release. If you need a particular setting or function available via WP CLI that is not available yet, kindly open a support ticket with your request.
The following is the list of the WP CLI commands currently available in WP Activity Log.
Plugin settings
Do not launch install wizard
This command is useful if you want to install the plugin automatically via WP CLI and you do not want the installation wizard to be triggered. When using this command, the default install values will be used.
Command: wsal_cli_commands remove_wizard
Activity log retention
With this command, you can configure the WordPress activity log retention. The default value is 6 months.
Command: wsal_cli_commands set_retention
Command options
Option name: –enabled
- Option type: boolean (true|false)
- Option default: true
Option name: –pruning-unit
- Option description: specify the time unit to be used for the retention.
- Option default: month
- Option values: days | months | years
Option name: –pruning_value
- Option description: specify the number to be used for the pruning unit.
- Option default: 6
- Option values: this option only accepts integer numbers.
Activity log retention WP CLI command example
The below example configures the activity log retention to 5 years.
wsal_cli_commands set_retention --enabled=true --pruning-unit=years --pruning-value=5Login page notification
This command enables the login page notification, which by default highlights that WSAL is installed.
Command: wp wsal_cli_commands login_page_notification
Command options
Option name: –enabled
- Option type: boolean (true|false)
- Option default: true
Option name: –text
- Option type: text (text must reside inside quotation marks)
- Option default: NA
Hide plugin
This command hides WP Activity Log from the Plugins > Installed Plugins list.
If wp wsal_cli_commands set_hide_plugin is set to anything else other than “1” or “true,” it will disable the option.
Command: wp wsal_cli_commands set_hide_plugin
Command options
- Option type: boolean (true|false) or integer (1|0). Anything other than positive or negative numbers or string ‘true’ will be treated as false. 0 – means false.
- Option default: NA
Notifications
Daily Activity log highlights email
To disable the daily activity log highlights email via WP CLI, run the following command:
Command: wp wsal_cli_commands remove_daily_notification
Weekly Activity log highlights email
To disable the weekly activity log highlights email via WP CLI, run the following command:
Command: wp wsal_cli_commands remove_weekly_notification
Enable or disable events
This command will look for the listed Event ID, and if it’s enabled, it will disable it. If the Event ID is disabled, it will enable it. The EVENT ID included in the command must be an existing Event ID as listed in the plugin-supported list.
Command: wp wsal_cli_commands disable_enable_alert
Command options
- Option type: integer (integer must be equivalent to an existing event ID)