WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am planning to schedule an hourly task from my wp plugin, as I understand these tasks are triggered by visits to the website.

So for an hourly task I will need at least one visitor hourly.

Does it matter at what time of the hour the visitor comes? For example if there's a visitor at 1:05, and another at 2:55, the 1 and 2hs task wont be missed?

share|improve this question
up vote 4 down vote accepted

As you've noted, cron jobs are only fired when someone visits your website. WordPress checks if they are any events that have been scheduled before 'now' that have not yet occurred - and runs them.

Importantly with events that are recur according to a regularly pattern (say hourly) - their occurrence is relative not absolute. That is, once your event triggers it will be scheduled again in an hour's time (rather than being schedule for 1:05, 2:05, 3:05) - of course with no guarantee that it will actually run in an hours time.

In fact with recurring events WordPress only keeps one occurrence saved. Once that occurrence is trigged it is replaced with the next one.

share|improve this answer
By cron in the above I'm obviously referring to wp-cron, in case there's any confusion :) – Stephen Harris Apr 18 '12 at 21:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.