WordPress

How to Clean wp_actionscheduler_logs in WordPress

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

  1. Login into your Ecenica cPanel control panel. See Where do I login to my hosting control panel
  2. Click phpMyAdmin
  3. Select your WordPress database from the left panel
  4. Click on the table named wp_actionscheduler_logs
    > (Note: It may be prefixed differently, like wp1x_actionscheduler_logs)
  5. Click the “SQL” tab at the top
  6. 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.

  7. Click Go to execute the query

Method 2: Clean via WP-CLI

  1. Access your Ecenica hosting account SSH or use our built in Terminal
  2. Navigate to your WordPress directory
  3. Run this command:

    wp db query "DELETE FROM wp_actionscheduler_logs WHERE scheduled_date_gmt < NOW() - INTERVAL 30 DAY;"
    
  4. Optionally, you can also optimize the table afterward:
    wp db optimize
    

Method 3: Clean Using MySQL from cPanel Terminal

  1. Login into your Ecenica cPanel control panel. See Where do I login to my hosting control panel
  2. Open the Terminal feature. See How to Access Terminal
  3. Run the following command, replacing placeholders with your actual database info:
    mysql -u YOUR_DB_USERNAME -p YOUR_DB_NAME
    
  4. Enter your database password when prompted

  5. Once in MySQL, run:

    DELETE FROM wp_actionscheduler_logs WHERE scheduled_date_gmt < NOW() - INTERVAL 30 DAY;
    
  6. 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

Was this guide helpful?

Need help with this?

Open a ticket and link to this guide so our team can see what you have tried.

View support tickets

Power your business with Ecenica Hosting

Built for WordPress and serious websites. Fast, secure and supported by real people in the UK.

Ecenica hosting services represented by a connected red route across London