Skip to content
Launch offer 50% off your first year of Keel Pro. See prices →

The work WordPress does behind your back: Heartbeat, revisions and cron

Open wp-admin tabs ping the server, every save stores a full copy of the page, and scheduled tasks run on visitors' requests. What each does and how to keep it in check.

Keel team · · 3 minutes read

Some WordPress slowness has nothing to do with visitors. It comes from work WordPress does in the background: while editors have wp-admin open, every time a page is saved, and whenever a scheduled task is due. On small hosting plans, this background work can slow the whole site.

Heartbeat: the tab that keeps calling

Every open wp-admin tab sends a small request to the server at regular intervals. This is the Heartbeat API. It powers useful things: autosave while you write, the warning that someone else is editing the same page, and notices that your login expired.

The cost: each request runs WordPress. An editor with five wp-admin tabs open all day sends thousands of requests, and so does every other editor. On cheap hosting with a limit on how many PHP processes can run at once, those requests compete with real visitors.

The sensible fix is to slow Heartbeat down outside the editor and leave it alone inside it. In Keel › Speed › Background activity, the Heartbeat setting offers “Slower: once a minute, off on the website” (the default) and “Only while editing content”. Either way the editor keeps it, because autosave depends on it.

Revisions: a full copy on every save

Every time a page or post is saved, WordPress stores a complete copy of it as a revision. That is how you can go back to an older version. But WordPress keeps every revision forever by default. A page edited 300 times has 300 copies in the database.

Revisions do not slow down normal page views much, but they make the database larger, backups slower and some admin screens heavier. Ten revisions per page are plenty to undo mistakes. Set Revisions to keep per page in the same screen.

Existing old revisions stay until you clean them up: see WordPress database cleanup.

WP-Cron: scheduled tasks on visitors’ time

WordPress runs scheduled tasks (publishing scheduled posts, checking for updates, sending queued emails, running backups) through a system called WP-Cron. It has no real clock. Instead, it checks on page requests whether something is due, and if so, starts it.

This has two side effects:

  • On a quiet site, tasks run late, because nobody visits to trigger them. A post scheduled for 9:00 may appear at 9:20.
  • On a busy site, the check runs constantly, and a heavy task can start during a visitor’s request.

The fix: a real cron job

Most hosts let you add a cron job in the hosting panel. The common setup:

  1. Add this line to wp-config.php, above “That’s all, stop editing”:
define( 'DISABLE_WP_CRON', true );
  1. In the hosting panel, add a cron job that runs every 5 minutes and calls https://yoursite.com/wp-cron.php, for example with wget -q -O - https://yoursite.com/wp-cron.php >/dev/null 2>&1.

Tasks then run on time, and never on a visitor’s request. If you are not comfortable editing wp-config.php, ask your host: many set this up for you.

Plugins that do too much in the background

Some plugins add their own scheduled tasks: statistics, link checks, social feeds, imports. Each is reasonable alone; together they can keep the server busy. If the site slows down at regular times, a plugin’s scheduled task is a good suspect. Tools like WP Crontrol show every scheduled task and how often it runs.

Summary

  • Slow Heartbeat down outside the editor.
  • Keep about 10 revisions per page, and clean up old ones.
  • Move WP-Cron to a real cron job on busy or very quiet sites.
  • Look at scheduled tasks if the site slows down on a schedule.

Common questions

Will turning Heartbeat down break autosave?

Not with Keel: the editor always keeps Heartbeat, because autosave and the “someone else is editing” warning depend on it.

Do revisions slow down my site for visitors?

Barely. They make the database bigger, which slows backups and some admin screens more than public pages.

Is it safe to switch off WP-Cron?

Only if a real cron job calls wp-cron.php instead. Without either, scheduled posts, update checks and backups stop running.

Keel does this for you.

Speed, security and SEO in one WordPress plugin, with plain-language settings. Free on any number of sites.

Get Keel free

Five minutes from now

Give your site a keel.

Steady when traffic spikes, calm when attacks come, found when people search. Start free; go Pro when a site needs more.