If you’re running a WordPress site with WooCommerce or other plugins that use background tasks, you might notice your database growing due to a table called wp_actionscheduler_logs. In this article, we’ll explain what it is, why you should consider cleaning it, and how to do it using several methods.
What is wp_actionscheduler_logs?
The wp_actionscheduler_logs table is part of the Action Scheduler, a background task runner used by WooCommerce and many other plugins. This table logs every completed scheduled action, storing information such as the action’s status, message, and completion time.
Over time, especially on busy WooCommerce sites, this table can grow significantly, leading to:
- Slower database performance
- Larger backups
- Difficulty managing the database via phpMyAdmin or other tools
Why Clean the wp_actionscheduler_logs Table?
Cleaning this table helps:
- Improve database performance by reducing table size
- Free up server space
- Speed up backup and restore times
- Reduce clutter in your database
It’s generally safe to remove old logs, especially those that are weeks or months old.
Method 1: Clean via cPanel phpMyAdmin
- Login into your Ecenica cPanel control panel. See Where do I login to my hosting control panel
- Click phpMyAdmin
- Select your WordPress database from the left panel
- Click on the table named wp_actionscheduler_logs
> (Note: It may be prefixed differently, like wp1x_actionscheduler_logs) - Click the “SQL” tab at the top
- Run this SQL query to delete old logs:
DELETE FROM wp_actionscheduler_logs WHERE scheduled_date_gmt < NOW() - INTERVAL 30 DAY;
Replace wp_ with your actual database prefix if it’s different.
- Click Go to execute the query
Method 2: Clean via WP-CLI
- Access your Ecenica hosting account SSH or use our built in Terminal
- Navigate to your WordPress directory
-
Run this command:
wp db query "DELETE FROM wp_actionscheduler_logs WHERE scheduled_date_gmt < NOW() - INTERVAL 30 DAY;"
- Optionally, you can also optimize the table afterward:
wp db optimize
Method 3: Clean Using MySQL from cPanel Terminal
- Login into your Ecenica cPanel control panel. See Where do I login to my hosting control panel
- Open the Terminal feature. See How to Access Terminal
- Run the following command, replacing placeholders with your actual database info:
mysql -u YOUR_DB_USERNAME -p YOUR_DB_NAME
- Enter your database password when prompted
-
Once in MySQL, run:
DELETE FROM wp_actionscheduler_logs WHERE scheduled_date_gmt < NOW() - INTERVAL 30 DAY;
- Exit MySQL:
exit
Notes
- Always back up your database before running delete operations
- Consider setting up a scheduled task or WP-CLI cron job to clear logs regularly
- Only delete logs older than needed — 30 days is typically safe