Action Scheduler Tables: Tips for a Leaner Faster WordPress

The Action Scheduler is a task runner in plugins such as WooCommerce, WooCommerce Subscriptions, MailPoet, and WP Mail SMTP. Many other plugins also use the Action Scheduler as an integrated task runner instead of maintaining other solutions..
If you have many actions running on your site, stored data can accumulate over time for the actions run and actions logged. It is not uncommon to find the actions or logs database table in the 10-20 GB range, which can go much higher in some edge cases.
The Action Scheduler database tables used are;
actionscheduler_actions
actionscheduler_claims
actionscheduler_groups
Actionscheduler_logs
Checking the Action Scheduler database tables
You can check the system status report from the WooCommerce status menu item in wp-admin on the site. It will display the size of the database tables. You can also find the size of the Action Scheduler database tables by using phpMyAdmin or a plugin such as WP-Optimize.


Optimize or truncate the Action Scheduler logos database table
If you are using phpMyAdmin and the logs Action Scheduler database table is in the 10+ GB range, you can select to empty that database table. If the logs Action Scheduler database table is under the 2+ range, you could optimize it.


Cleanup Action Scheduler using Code Snippets
Using this code snippet, you can reduce the Action Scheduler retention from the default to a week. The code snippet can be deployed on connected sites using the code snippets extension from MainWP.
The action scheduler should typically avoid high storage usage issues on your sites. Still, it is well worth checking if failed actions have stacked up on the site and then caused bloat in action and logs Action Scheduler database tables. Since overly large database tables will cause slower backup for the database, all reasonable external backup solutions would include files and the site’s database.
Useful Links
https://github.com/woocommerce/woocommerce/wiki/Database-Description#table-overview
https://actionscheduler.org/faq
https://github.com/woocommerce/action-scheduler
https://kb.mailpoet.com/article/129-newsletter-task-scheduler-cron#action-scheduler
https://wordpress.org/support/topic/tools-scheduled-actions-completed-keeps-growing
https://wpmailsmtp.com/docs/how-to-troubleshoot-action-scheduler-issues-wp-mail-smtp-2-1-1
Share
Manage Unlimited WordPress Sites from One Dashboard!
- Privacy-first, Open Source, Self-hosted
- Easy Client Management
- 15+ & 30 + Premium Add-ons
- Bulk Plugins & Themes Management