Technical Details for Future Action Logs

To process large queues of tasks in WordPress, Future Action uses Action Scheduler, which is a scalable job queue for background processing. The same library is being used by WooCommerce, the popular eCommerce plugin.


Deleting Future Action Logs #

PublishPress Future will retain “completed” log items for 30 days. You can always delete the logs manually by selecting the logs and using the “Bulk actions” feature in this screenshot:


Where are the logs stored in the database? #

The logs for Future Action are stored in two tables: wp_actionscheduler_logs and wp_actionscheduler_actions.

You can safely delete these logs directly from the database using SQL commands. For instance:

DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'canceled'
DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'failed'
DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'complete'

This will delete logs that have the status canceled, failed, or complete from the wp_actionscheduler_actions table.

Make sure to adjust the table prefix. In the above example, we use “wp_” which are the most common one.

table prefix

Since the statuses of ‘failed', ‘canceled', or ‘complete' are already in the past, it is safe to delete them from the wp_actionscheduler_actions table.


Programmatically Deleting Future Action Logs #

PublishPress Future will retain “completed” log items for 30 days. However, if you want to shorten this time, you can use the following filter. You could apply it on your function.php or using some code snippet plugin.

This code below will change the retention time to one week. 604800 is the value for one week in seconds. If you want to delete the logs every three days, you can change it to 259200.

add_filter( 'action_scheduler_retention_period', 'ppf_delete_logs' );
/**
 * Change Action Scheduler default purge to 1 week
 */
function ppf_delete_logs() {
 return 604800;
}