Blog / How the internet works /

Why websites need cron jobs

You schedule a blog post for 9 a.m. At 9:30 it still hasn’t gone live, and the dashboard says “Missed schedule”. Nothing is wrong with your post. The thing that was meant to publish it, a scheduled task, simply didn’t run. Websites need a clock, and cron is the clock.

What a cron job is

Cron is a scheduler built into Linux and Unix-style servers, which is what most web hosting runs on. A cron job is a task you tell the server to run automatically at a set time or interval: every minute, every night at 2 a.m., on the first of each month.

It’s the alarm clock on a server. You don’t have to be there. At the time you set, it runs the command.

The timing is written in a compact format of five fields: minute, hour, day of month, month and day of week. For example, */15 * * * * means every fifteen minutes. Most hosting panels, including cPanel, let you add cron jobs through a form, so you don’t have to remember the syntax.

What websites use scheduled tasks for

More than you’d think:

  • Publishing scheduled posts.
  • Backups, run nightly or weekly.
  • Sending emails and newsletters in batches.
  • Checking for updates to plugins, themes and WordPress itself.
  • Clearing old data: expired sessions, temporary files, spam comments.
  • Syncing stock, prices or orders between a shop and other systems.
  • Renewing subscriptions and sending payment reminders.
  • Rebuilding sitemaps and refreshing caches.
  • Posting to social media on a timetable.
  • Security scans.

If any of these silently stops, the site seems to work, but things slowly go wrong. That’s why cron problems are easy to miss.

WP-Cron: WordPress’s own version

WordPress doesn’t rely on the server’s clock by default. It has WP-Cron, a system that checks for due tasks every time someone visits the site. If a task is due, WordPress runs it then.

That works on a site with steady traffic and needs no setup. But it has two weaknesses:

  1. No visitors, no tasks. On a quiet site, nobody visits at 9 a.m., so your scheduled post waits until the next visit. That is the “missed schedule” problem.
  2. Extra load on busy sites. Checking for tasks on every page load adds a little work each time, and heavy tasks can run while a visitor waits.

Think of a shop where the owner only opens the delivery door when a customer walks in. Fine for a busy shop. On a slow Tuesday, deliveries sit outside.

The fix: a real cron job

The usual improvement has two steps.

  1. In wp-config.php, turn off the visitor-triggered version by adding:
    define('DISABLE_WP_CRON', true);
  2. In your hosting panel, set up a real cron job that calls WordPress’s cron file at regular intervals, for example every five or ten minutes. The command is typically a request to wp-cron.php on your domain, or a command-line call, depending on your host. Your host’s documentation will give the exact line for their setup.

Now the server’s clock, not a visitor, triggers the tasks. Scheduled posts go out on time even at 3 a.m. with nobody around.

Back up before editing wp-config.php, and test afterwards by scheduling a post a few minutes ahead. I’d say the same of most config changes, and it’s part of the routine in a web admin’s daily checklist.

Cron problems to watch for

  • Missed schedules: the classic sign.
  • Tasks that never finish. A heavy job exceeds the time limit and gets cut off, then runs again, and again.
  • Tasks piling up. If the server is slow, queued jobs stack up and use more resources.
  • Overlapping runs. A job starts again before the last one is done.
  • Caching getting in the way. If a page cache or firewall blocks requests to wp-cron.php, tasks won’t run. Some security setups do this on purpose.
  • Wrong time zone. The schedule fires, but at a different hour than you thought. Check WordPress’s time zone setting and the server’s.
  • A host that restricts cron. Some shared plans limit how often cron can run. Check what yours allows.
  • A plugin that adds too many events. Some stuff is scheduled every minute for no good reason.

How to see what’s scheduled

In WordPress, plugins such as WP Crontrol let you view, run and delete scheduled events. You can see what’s due, what’s overdue and which plugin created each task. That’s very useful when a site feels slow for no clear reason: sometimes a runaway job is the cause.

On other platforms the idea is the same under different names. Shopify and similar hosted platforms run scheduled tasks for you, which is one of the quiet advantages of hosted systems. If you use an app that syncs data on a schedule, check how often it really does and what happens when it fails.

Why this matters to site owners

Cron failures don’t announce themselves. A backup that stopped running three weeks ago looks the same as a working one until the day you need it. A sitemap that never refreshes, a newsletter that isn’t sent, a subscription that isn’t renewed: all of them are silent.

So build checks into your routine. Confirm backups have recent dates. Watch for “Missed schedule” labels in your post list. Look at your scheduled events now and then. And if a task matters, have something tell you when it fails, such as a monitoring service that expects a regular ping from the job and complains if it doesn’t arrive.

Key takeaways

  • Cron runs tasks on a schedule; websites rely on it for publishing, backups, emails and clean-up.
  • WP-Cron runs tasks only when someone visits, so quiet sites miss schedules.
  • A real server cron job plus DISABLE_WP_CRON makes timing reliable.
  • Failures are silent, so check them regularly.
  • Always test after changing cron settings.

Look at your WordPress post list today. Any “Missed schedule” posts hiding in there?