Too many failed or pending actions in Action Scheduler table

WP Rocket uses Action Scheduler for Preload and Remove Unused CSS, so you will see these hooks in the wp_action_scheduler table:

  • Remove Unused CSS 
    • rocket_rucss_job_check_status
    • rocket_rucss_pending_jobs_cron
  • Preload
    • rocket_preload_job_preload_url
    • rocket_preload_job_check_finished - this checks if the preload job that is in progress has finished and it is scheduled to run every 1 minute. Don’t be alarmed if you see many of these with the “complete” status - that means it’s working correctly.

If you see too many pending or failed actions related to the above, follow these steps:

  1. Make sure cron is running regularly. Both features depend on cron and if it’s not running often enough, the actions will stack up.
    You can do this by using the WP-Cron Status Checker plugin, as described here: Check WP Cron with a plugin
  2. Set up a real cron job to call wp-cron.php regularly as described here:
    Setting up a cron job on the server

    If you already have a cron job set up, you may need to increase the frequency.
    For example, a 15 minute interval may be too long. We recommend 1 or 5 minutes.
  3. After setting up the cron, restart Preload or Clear the Used CSS from the top menu options?.
  4. If the problem continues and the action_scheduler table continues to get bloated, you can directly remove the related actions from the database.
    ❗️Do not run this yourself unless you know what you are doing!  You should ask your host to do this for you, to avoid errors.  Create a database backup before any action is taken❗️

    Please note:

    • In your case, the database prefix may be different from wp_, so you may need to replace it.
    • You can increase the LIMIT 100 value to LIMIT 500 or LIMIT 1000, gradually, making sure the query doesn't crash the database server.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.