WordPress Cron vs Real Cron: Why wp-cron.php Slows Your VPS

Every WordPress site on a VPS runs scheduled jobs in the background: publishing queued posts, checking for plugin updates, sending email, clearing expired transients. On a default install, those jobs run through wp-cron.php, which only fires when someone visits your site. The wordpress cron vs real cron question comes down to who triggers the work: a random visitor, or your server clock. When a visitor triggers it, that visitor waits while your server does chores before it serves the page.

On shared hosting you rarely notice this. On a small VPS with 1 or 2 GB of RAM, you do: one heavy scheduled job can eat the memory your PHP workers need, and a traffic spike can trigger the same checks again and again. The fix costs nothing: hand scheduling to the operating system instead.

WordPress Cron vs Real Cron: How Each One Actually Works

wp-cron.php is not a cron job. It is a piece of PHP that WordPress runs inside a normal page request. When a visitor loads a page, WordPress checks whether any scheduled task is due. If one is, it fires a separate request to wp-cron.php in the background. That background request loads the whole WordPress stack a second time, runs the due jobs, and exits.

A real cron job works the other way around. The Linux cron daemon wakes up at a time you set, runs a command, and goes back to sleep. Nobody has to visit your site. The job runs at 02:00 because the clock says 02:00, not because a reader happened to open a post at 02:00.

The practical difference shows up in three places: timing, load, and reliability. wp-cron runs jobs late on quiet sites and at the worst moment on busy ones. A real cron runs jobs on time, in a separate process, with no visitor attached. If you want the full setup, our guide on running WordPress cron properly on a VPS walks through the exact commands.

wp-cron.php Real cron
Trigger A site visit The server clock
Timing Late on quiet sites On schedule
Load Inside a page request Separate process
Reliability Skips jobs with no traffic Runs with zero visitors

Why wp-cron.php Slows Your VPS

wp-cron.php loads all of WordPress. That means every trigger spins up PHP, connects to MySQL, loads your theme and active plugins, and only then runs the scheduled job. On a 1 GB VPS, that second WordPress load competes with the first one for the same small pool of memory. If PHP-FPM is already near its worker limit, the visitor’s own page load queues behind it.

Traffic makes it worse. WordPress checks for due jobs on every visit, and a busy hour means hundreds of checks. WordPress does use a lock to stop the same job running twice at once, but the check itself and the spawned request still cost CPU and RAM. The result is slowdown that is hard to pin down: most pages load fine, then one random request takes several seconds. If you have chased that symptom before, our walkthrough on fixing slow TTFB on a VPS covers the same class of problem from the server side.

The jobs themselves are the bigger problem. A backup plugin, a feed importer, or a security scan can run for a minute or more. Under wp-cron, that work happens inside a web request with a time limit, so long jobs can get killed halfway or pile up and retry on the next visit. A system cron runs the same job as a plain shell process with no web server timeout hanging over it, and you can log its output to a file and read it later.

The Signs wp-cron Is Hurting Your Site

You do not need a monitoring stack to spot this. Look for page loads that are fast most of the time and randomly slow for no clear reason, with nothing in the access log to explain the slow ones. Look at the WordPress admin feeling sluggish even when the front end is fine, since admin pages trigger cron checks too. Our guide to troubleshooting a slow WordPress admin on a small VPS lists the same checks in order, and cron is one of the first suspects.

Scheduled posts publishing late is the clearest tell. If a post set for 08:00 appears at 11:30, wp-cron only fired when the first visitor after 08:00 arrived. CPU spikes that do not line up with traffic peaks are another: check your process list during a spike and look for a second PHP-FPM worker running wp-cron.php while the site itself is quiet.

How to Switch to a Real Cron

The switch has two parts: stop WordPress from triggering jobs on visits, then schedule the trigger yourself. Both take about five minutes.

First, disable wp-cron in wp-config.php. Add this line above the “stop editing” comment:

define('DISABLE_WP_CRON', true);

That single constant is what “disable wp-cron” means in practice: WordPress stops firing scheduled jobs during page loads. Nothing else changes. Your scheduled posts, update checks, and plugin jobs all stay registered; they simply wait for something else to trigger them. Do not skip this step. Without it, visitors keep triggering jobs on top of your new cron, and you get duplicate runs.

Second, add a system cron entry that calls wp-cron.php every five minutes. Open the crontab for the user that owns your WordPress files, usually www-data, and add:

*/5 * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

If you have WP-CLI installed, the cleaner version runs the due events directly instead of going through HTTP:

*/5 * * * * cd /var/www/yoursite.com && wp cron event run --due-now --path=/var/www/yoursite.com

Change the path and domain to match your server. Five minutes is a sane default: scheduled posts publish within five minutes of their time, and the server does one small job instead of checking on every visit.

Run the cron entry as the same user that owns the WordPress files, or you will create cache and upload files owned by root that PHP cannot overwrite later. Also guard against overlapping runs: if a job takes longer than five minutes, the next trigger should not start a second copy. Our guide on running a cron job without overlapping runs shows the flock pattern that prevents this.

Verify the switch: wp cron event list shows the next run time for each job, and your cron log should show the call firing every five minutes. Publish a test post scheduled two minutes ahead and confirm it goes live on time.

What About Low-Traffic Sites?

Low-traffic sites gain the most from this change. With wp-cron, a site that gets a handful of visits a day runs its jobs whenever a visitor happens to show up, which means scheduled posts drift and update checks lag. With a real cron, jobs run on time whether anyone visits or not. The server does a few seconds of work every five minutes, which is nothing next to the memory a single visitor-triggered wp-cron run uses.

Some people point an uptime monitor at the site so it gets pinged every minute. That keeps wp-cron firing, but jobs still run inside web requests and still depend on an outside service. A system cron is the same amount of setup and removes the dependency entirely.

Common Mistakes After the Switch

The most common mistake is disabling wp-cron and never creating the replacement. With DISABLE_WP_CRON set and no system cron, nothing runs at all: scheduled posts never publish, update checks stop, and plugins that rely on scheduled tasks quietly break. If your scheduled posts stop appearing after the change, this is the first thing to check.

The second mistake is running the cron entry as root. Files created by a root-run job end up owned by root, and the web server user cannot update or delete them later. Run the entry as www-data or whichever user owns the site files.

Do not set the interval to every minute just to be safe. Most WordPress scheduled tasks are hourly or daily, so a one-minute trigger adds sixty extra process spawns an hour for no benefit.

Frequently Asked Questions

Does disabling wp-cron break scheduled posts?

No, as long as the system cron is in place. Disabling wp-cron only stops the visitor-triggered check; the jobs stay registered and the system cron runs them on schedule. Breakage only happens when the replacement cron is missing.

How often should the system cron call wp-cron.php?

Every five minutes is the standard answer. It keeps scheduled posts within five minutes of their target time and adds almost no load. Every minute is overkill for nearly every site, and every fifteen minutes is fine if nothing on the site is time-sensitive.

Can I use a systemd timer instead of cron?

Yes. A systemd timer with a five-minute interval does the same job and gives you journal logs for free. The wp-config.php change is identical either way.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.