• Hi,

    does somebody know how to set up cronjob for a specific hour (like – 00:01) every day with cron_schedules filter?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • I think what you’re looking for doesn’t exist. WordPress cron is managing interval but not specific hours.

    You’ll need to use an external cron to call your function.

    Moderator bcworkz

    (@bcworkz)

    It’s true, cron schedules only define intervals, not specific times. However, when you call wp_schedule_event(), you pass a timestamp for when the first event should execute. It then re-executes at the specified interval. If you choose a daily interval, it will occur roughly at the same time every day.

    “Roughly” is an important distinction. WP crons only execute when WP receives a request on or after the specified timestamp. On a lightly trafficked site, it could be a while before a request comes in to trigger the cron task.

    If you require more precise timing you should rely upon server cron jobs.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘cron for a specific hour’ is closed to new replies.