WooCommerce by default deletes the logs within 30 days. However, it lets you control this feature via
This is a small plugin built on top of that filter that will let you define the number of days you’d like to keep the logs for.
- Install and Activate this plugin
- Configure the number of days log should be kept under WooCommerce > Settings > General > WooCommerce Logs > Days to keep logs – Define the number of days here
- Plugin will ensure that logs are removed after days you’ve defined.
This setting works with
woocommerce_cleanup_logs cron job that runs daily. You’ll want to either wait until the cron job runs, or manually run it if you want to see it in action before that.