Set Log Purge Retention Settings for WP Activity Log by Melapress

May 19, 2026 | IT Tips | 0 comments

Written By James McDonald

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

Written By James McDonald

undefined

Explore More IT Insights

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.