Managing WP Cron with WP Crontrol Plugin

In Software Review by Bintoro Adi Guna1 Comment

Anda berbicara Bahasa Indonesia? Baca artikel terjemahannya di sini!

Last time, I already posted about fixing scheduled posts that miss their schedule, and it had something to do with WordPress cron. This time, I’ve found a plugin that can accurately tell us whether our cron has been executed on schedule or not, since WordPress cron is not a real cron (as a refresher, it will only execute when a visitor visits your site, so there’s no guarantee of reliability on a low-traffic site). The plugin name is WP Crontrol, and in this article, I’m going to share how to use it.

Installing WP Crontrol Plugin

Installing the plugin is the same as other WordPress plugins. You can either search for it, or quickly go to it through this link, then install it as usual.

Once installed, you should have a new entry Cron Events in the Tools menu. You can see the cron schedules in the table, as well as when it’s scheduled to run and when it was last run.

wp-crontrol-cron-events

If you want to edit a cron task, simply hover over the task row, and click Edit.

wp-crontrol-edit-cron-events

Adding New Cron Task

If you want to create a new cron task, you can click Add New.

From this window, we can create a new cron task, which uses either a hook, or raw PHP code. As for the hook, we can connect them to an action. I personally haven’t tried this, but WordPress has a comprehensive documentation here on how to do it.

wp-crontrol-add-cron-event

One example is a default cron called wp_update_themes. It’s an action that was hooked to a function with the same name in this file.

Viewing Cron Schedules

There’s also the second tab, Cron Schedules, where you can see the intervals of each of your cron task. Once you’ve finished creating a new task, you can set the run interval in this section.

wp-crontrol-cron-schedules

Conclusion

So, using WP Crontrol, we can easily keep track of our current cron tasks. But remember, if you previously disabled WP_CRON, you’ll need to manually set up a cron to execute the tasks, otherwise, nothing will happen.

Well, that’s all for now, Folks. Hopefully, this little article can help you in case you need it in the future. As usual, don’t hesitate to sound off your comments and questions below. Finally, thanks for reading and see you in the next article! ????

Comments

  1. Pingback: Mengatur WP Cron dengan Plugin WP Crontrol - Technoverse

Leave a Comment