Run tasks on a schedule (cron)

Updated 2 days ago 8 views

A scheduled task runs a PHP file of one of your websites on a schedule, the way a cron job does on other hosts: WordPress's own background jobs, or a script of yours (a newsletter queue, an import, a clean-up). You set them up in the Control Panel under Scheduled tasks, in the Websites group.

WordPress's scheduled tasks

WordPress keeps a list of background jobs (WP-Cron): publishing scheduled posts, plugin jobs such as backups, SEO updates or security scans, update checks. By default WordPress starts them when someone visits the site, so on a quiet site they run late, and on a busy one a visitor now and then waits for them.

To have them run on time:

  1. In Scheduled tasks, choose Add a scheduled task.
  2. Choose the site and WordPress's scheduled tasks (wp-cron.php).
  3. Choose how often: every 5, 15 or 60 minutes. Every 5 minutes suits most sites.

Once the task shows OK under Last run, you can stop visits from starting the jobs too. Add this line to the site's wp-config.php, above the line /* That's all, stop editing! */:

define('DISABLE_WP_CRON', true);

Nothing breaks without it: WordPress then simply keeps starting the jobs on visits as well.

Your own scripts

A script is a .php file inside the site's folder. Give its path relative to the folder, for example cron/job.php for the file cron/job.php in the folder of example.com, and choose when it runs:

  • every 5, 10, 15 or 30 minutes,
  • every hour, at a minute you choose,
  • every day, at a time you choose,
  • every week, on a day and at a time you choose.

Times are New York time (US Eastern). Tasks that run every few minutes start at a minute of their own, so that not every task on the server starts at the same moment; the list shows when each task runs next.

The script runs without arguments, as php cron/job.php would in its folder. Only PHP files can be scheduled, not shell commands or other programs. It is a good idea to keep such scripts out of reach of visitors, for example by having them check PHP_SAPI === 'cli' before they do anything.

How a task runs

  • As your account, with your site's PHP settings (see Change PHP settings) and the same restriction as the site's web pages: it can only open files in the site's folder and the temporary folder.
  • At a low priority, so that your websites stay fast while it runs.
  • For at most 10 minutes; a run that takes longer is stopped. If a run is still going when the next one is due, the next one is skipped.
  • In the data centre that serves your sites at that moment: if our hosting switches to the other data centre, your tasks run there.

Following your tasks

The list shows for each task:

Column What it means
State Active: it runs on schedule. Paused: you paused it. Being set up or Awaiting approval: a change is on its way. Not running: it is set up but does not run for now, for the reason shown (for example while the hosting is suspended)
Last run OK, Failed (the script ended with an error), Stopped: took too long, Not run (for example the script file is missing) or Skipped, with the time

Output shows what the last run printed, its errors included. PHP errors are also written to your PHP error log (see Read your website's error logs). The last run is updated every few minutes.

Change edits a task, Pause stops it without losing it (Resume starts it again), and Delete removes it. Deleting a task does not delete its script.

Limits

  • Up to 5 scheduled tasks per hosting account (the list shows how many you use), and one WordPress task per site.
  • A task runs at most every 5 minutes.
  • Staging sites run no scheduled tasks: a staging copy deliberately sends no email and runs no WordPress background jobs, so that it never repeats the live site's work (orders, newsletters, payments). See Try changes on a staging site first.

If you need something these options do not cover, contact us.

Still need help?

If this article did not answer your question, our support team can help.

Contact support
© 2026 Maplegrove Hosting - Powering Your Digital Footprint
Top