To stop the activity log growing forever. Set a retention period.
The following triggers WP Activity Log to prune log entries older than 2 months
# the following is a more complex command that executes as a particular user
sudo -u youruser /usr/local/bin/wp --path=/var/www/example.com/webroot wsal_cli_commands set_retention --enabled=true --pruning-unit=months --pruning-value=2
# simple command
# change to the directory that has wp-config.php in it
cd /var/www/example.com/webroot
wp wsal_cli_commands set_retention --enabled=true --pruning-unit=months --pruning-value=2
Reference: https://melapress.com/support/kb/wp-cli-commands-wp-activity-log
0 Comments