Schedule cron jobs with WordPress

A cron job let’s you automaticly execute a function at a specific interval – WordPress can do this for you with the wp_schedule_event() function. Here is how you can schedule a hook which will be executed by the WordPress actions core on a specific interval (in this example it will execute the cron job each hour), specified by you. The action will trigger when someone visits your WordPress site, if the scheduled time has passed.

Add this code to your functions.php file.

Related links:


One Reply to “Schedule cron jobs with WordPress”

Leave a Reply

Your email address will not be published. Required fields are marked *

Snippet Info

Tested with Wordpress v. NA
Review Status: Needs Review

Schedule cron jobs with WordPress
4.6 (91.11%) 9 vote[s]
Please report broken snippets.
Report Broken Snippet