Pantheon Community

Identifying And Removing Cron Jobs That Are No Longer Needed?

This is really more of a general WP question, but I thought I would ask it here anyway. Since I have migrated to Pantheon, I now have visibility into all of the cron jobs that are scheduled and running on my site. I have recognized a few of them as old cron jobs from plugins that have since ben deleted. However, I am looking for the best way to identify all of my active cron jobs that are no longer needed. Any thoughts on this?

Either of these plugins should be a quick and easy option to manage your cron jobs.


As for a method to identify which cron jobs are no longer needed, I do not know of any solution other than manually looking through your codebase for all the wp_schedule_event function calls, and removing the crons that you do not find.

2 Likes

WP-CLI has a few commands that can help with this if you’d rather not add a plugin for it. You can run WP-CLI commands on your site via Pantheon’s command-line tool, Terminus.

List all the cron jobs scheduled on the dev environment for a site called “sitename”:

terminus wp sitename.dev -- cron event list

Delete a scheduled cron job:

terminus wp sitename.dev -- cron event delete hookname

You can get the hook name from output from the “cron event list” command.

1 Like