How7o
  • Home
  • Tools
  • Prank Screens
  • Contact
  • Blog
Reading: How to Set Up a System-Based Cron Job in WordPress
Share
Subscribe Now
How7oHow7o
Font ResizerAa
  • Marketing
  • OS
  • Features
  • Guide
  • Complaint
  • Advertise
Search
  • Home
  • Tools
  • Prank Screens
  • Contact
  • Blog
Follow US
Copyright © 2014-2023 Ruby Theme Ltd. All Rights Reserved.
How7o > Blog > Web Development > How to Set Up a System-Based Cron Job in WordPress
Web Development

How to Set Up a System-Based Cron Job in WordPress

how7o
By how7o
Last updated: May 10, 2026
7 Min Read
WordPress system cron — DISABLE_WP_CRON + system crontab hitting wp-cron.php
SHARE

A wordpress system cron setup replaces WordPress’s traffic-triggered WP-Cron with a real OS-level cron that hits wp-cron.php at a predictable interval. On low-traffic sites this fixes the common “scheduled event didn’t fire” bug — WP-Cron only runs when someone visits, so at 2am with no traffic it just waits. This guide walks through disabling WP-Cron in wp-config.php, adding a cPanel cron entry, and picking between the wget and php -q command forms.

Contents
  • TL;DR
  • Step 1 — Disable WP-Cron
  • Step 2 — Add the system cron entry
  • Via cPanel (no SSH needed)
  • Picking the interval
  • Verify it’s actually firing
  • Frequently asked questions
  • Related guides
  • References

Last verified: 2026-04-23 on WordPress 6.5 with cPanel and a stock Ubuntu crontab. Originally published 2024-02-23, rewritten and updated 2026-04-23.

TL;DR

// 1. Disable WP-Cron in wp-config.php (above the "stop editing" line)
define( 'DISABLE_WP_CRON', true );
# 2. Add a real cron — every 5 minutes
*/5 * * * * /usr/bin/php -q /path-to-your-wp-installation/wp-cron.php

Step 1 — Disable WP-Cron

// wp-config.php — above the "That's all, stop editing!" comment
define( 'DISABLE_WP_CRON', true );

This stops WordPress from running the “any cron events due?” check on every page load. The scheduled events still exist — they just wait for something to explicitly call wp-cron.php, which your system cron is about to do.

Place the define() above the /* That's all, stop editing! Happy publishing. */ comment. The line has to run before WordPress loads its core settings.

Step 2 — Add the system cron entry

Two common command forms:

# Via PHP CLI (cleaner, bypasses the web server)
*/5 * * * * /usr/bin/php -q /path-to-your-wp-installation/wp-cron.php

# Via wget (works when PHP CLI isn't available)
*/5 * * * * wget -q -O - http://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Pick PHP CLI when you can (most VPS hosts, many shared hosts with SSH). It avoids the HTTP round-trip and doesn’t get blocked by Basic Auth or IP restrictions on the site.

Pick wget when PHP CLI isn’t available — fully-managed shared hosts without SSH, hosts that restrict exec but allow outbound HTTP. The >/dev/null 2>&1 silences output so cron doesn’t email you every 5 minutes.

Via cPanel (no SSH needed)

  1. Log into cPanel.
  2. Advanced → Cron Jobs.
  3. Set the interval — pick Every 5 Minutes from the “Common Settings” dropdown, or manually */5 * * * *.
  4. Paste one of the command forms above, replacing example.com and the installation path with your values.
  5. Save.

Plesk, aaPanel, and DirectAdmin have similar Scheduled Tasks / Cron Jobs UIs in the same spot.

wordpress system cron — DISABLE_WP_CRON + a crontab hitting wp-cron.php every N minutes

Picking the interval

  • */1 * * * * — every minute. Only when something genuinely needs minute-level precision.
  • */5 * * * * — every 5 minutes. Common default. Good tradeoff between responsiveness and overhead.
  • */15 * * * * — every 15 minutes. Fine for daily / weekly events where a 15-minute drift doesn’t matter.
  • 0 * * * * — once an hour. Risk is that any sub-hourly event fires up to 60 minutes late.

Remember: the system cron doesn’t run your WordPress events directly, it just gives WordPress a chance to fire whichever events are due. The per-event schedule (hourly, daily, custom) still comes from the wp_schedule_event call; the system cron is the heartbeat that asks WordPress to check.

Verify it’s actually firing

# WP-CLI — the cleanest check
wp cron event list

# Or check via PHP
wp eval 'var_dump(_get_cron_array());'

The Next Run column should update every time the interval ticks. If it doesn’t move, the cron isn’t firing — verify the crontab with crontab -l (CLI) or the cPanel Cron Jobs list, and check the command path is correct.

Frequently asked questions

Why is wordpress system cron better than WP-Cron?

WP-Cron only fires when someone visits the site — each request checks “anything due?” and runs the overdue events in-process. On low-traffic sites that means scheduled jobs can miss their window by hours (a 2am task doesn’t fire until the first visitor at 9am). A system cron runs at exact times regardless of traffic. Swap to it whenever precise timing matters.

What does DISABLE_WP_CRON actually do?

It flips an internal flag that stops WordPress from checking the schedule on page loads. Scheduled events still exist — they just don’t fire until something explicitly hits wp-cron.php. Your system cron (the crontab entry below) becomes the thing that triggers the check.

wget or php -q — which should I use?

php -q /path/to/wp-cron.php runs cron via the command-line PHP and bypasses the web server entirely — faster, no request/response overhead, and it works even if the site is behind auth or a firewall that would block the wget call. Use wget only when you can’t run PHP from cron (some shared hosts). Both work; CLI is cleaner when available.

What’s a sensible interval for the cron entry?

Every 5–15 minutes is the sweet spot. WordPress events store their due-time; the cron just gives them a chance to fire. Running every minute is wasteful — most minutes have nothing to do. Running once an hour means a twice-daily event could fire 59 minutes late. */5 * * * * (every 5 minutes) is the common default.

How do I verify the cron is actually firing?

Install WP-CLI and run wp cron event list — it shows every scheduled event with the next/last run timestamps. If an event’s “Next Run” keeps sliding forward by the interval each time you check, the cron is firing. The raw option get_option('cron') also exposes the schedule in wp-config.php or a quick wp eval.

Related guides

  • How to Schedule a Cron Job in WordPress Without a Plugin — the sibling guide that defines the events this cron fires.
  • How to Disable Revisions and Autosave in WordPress — another wp-config.php tweak.
  • Fix ERR_TOO_MANY_REDIRECTS in WordPress After Switching to HTTPS — another wp-config.php fix.
  • How to Run a Laravel Project from GitHub — cron-scheduled job concepts in another framework.

References

WordPress advanced-administration on WP-Cron: developer.wordpress.org/advanced-administration/performance/cron.

TAGGED:configurationcPanelcronphpwordpress

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Previous Article WordPress cron job without a plugin — cron_schedules, wp_schedule_event, and action callback How to Schedule a Cron Job in WordPress Without a Plugin
Next Article WordPress admin notice — four notice types shown at the top of the admin area How to Show Custom Notifications in the WordPress Dashboard
Leave a Comment

Leave a Reply Cancel reply

You must be logged in to post a comment.

FacebookLike
XFollow
PinterestPin
InstagramFollow

Subscribe Now

Subscribe to our newsletter to get our newest articles instantly!
Most Popular
Display PHP errors — ini_set + php.ini configuration
How to Display PHP Errors
May 10, 2026
PHP convert string to uppercase — strtoupper and mb_strtoupper
How to Convert a String to Uppercase in PHP
May 10, 2026
PHP string to float conversion with cast, regex cleanup, NumberFormatter
How to Convert a String to Float in PHP
May 10, 2026
PHP merge arrays without duplicates — union operator and array_unique
How to Combine Two Arrays Without Duplicates in PHP
May 10, 2026
PHP delete array element — unset, array_splice, array_filter, array_search
How to Delete an Element from a PHP Array
May 10, 2026

You Might Also Like

Step-by-step guide to upgrading the Linux kernel in CentOS 7 using ELRepo
Server Management

How to Upgrade the Linux Kernel in CentOS 7

9 Min Read
Laravel Eloquent records today — Carbon today helper and whereDate illustration
Web Development

How to Get Records Created Today in Laravel

6 Min Read
Find prime numbers in JavaScript thumbnail
Web Development

How to Find Prime Numbers in JavaScript (1 to 100) — Fast & Simple Methods

5 Min Read
mysqldump all databases — export and import commands
Server Management

How to Export and Import All MySQL Databases at Once

6 Min Read
How7o

We provide tips, tricks, and advice for improving websites and doing better search.

Latest News

  • SEO Audit Tool
  • Client ReferralsNew
  • Execution of SEO
  • Reporting Tool

Resouce

  • Google Search Console
  • Google Keyword Planner
  • Google OptimiseHot
  • SEO Spider

Get the Top 10 in Search!

Looking for a trustworthy service to optimize the company website?
Request a Quote
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?