![]() |
|
Guide CyberPanel Cron Jobs: Add a Cron Job and Replace WP-Cron With a Real One - Printable Version +- AdminsForum (https://adminsforum.com) +-- Forum: Free & open-source control panels (https://adminsforum.com/Forum-free-open-source-control-panels) +--- Forum: CyberPanel (https://adminsforum.com/Forum-cyberpanel) +---- Forum: CyberPanel Guides & Tutorials (https://adminsforum.com/Forum-cyberpanel-guides-tutorials) +----- Forum: CyberPanel Websites & OpenLiteSpeed Guides (https://adminsforum.com/Forum-cyberpanel-websites-openlitespeed-guides) +----- Thread: Guide CyberPanel Cron Jobs: Add a Cron Job and Replace WP-Cron With a Real One (/Thread-guide-cyberpanel-cron-jobs-add-a-cron-job-and-replace-wp-cron-with-a-real-one) |
CyberPanel Cron Jobs: Add a Cron Job and Replace WP-Cron With a Real One - JAY - 10-26-2026 CyberPanel Cron Jobs: Add a Cron Job and Replace WP-Cron With a Real One A cron job runs a command on a schedule: a backup script every night, a Laravel scheduler every minute, a WordPress task runner every five minutes. CyberPanel has a page for this per website, so you don't need to open crontab by hand. Below we add a real job on our test site and use it for the most common case: replacing WordPress's built-in WP-Cron. Where to find it Open Websites > List Websites, click Manage on your site and find Cron Jobs. The direct address is: Code: https://YOUR-SERVER-IP:8090/websites/listCron?domain=yourdomain.comCode: cyber2602Step 1: Fill in the schedule The Pre defined dropdown fills the five time fields for you: every minute, every 5 minutes, every 30 minutes, every hour, every day, every week, every month, every year. Pick one, or type your own values:
Code: timedatectlStep 2: The command (use the full PHP path) Here is the form filled in for WordPress, with the Every 5 minutes preset: The field hint says Code: /usr/bin/php /path/to/script.phpCode: /usr/bin/phpCode: ls -l /usr/bin/php
/usr/bin/php -> /usr/local/lsws/lsphp83/bin/phpCode: /usr/local/lsws/lsphp81/bin/phpCode: /usr/local/lsws/lsphp82/bin/phpCode: /usr/local/lsws/lsphp83/bin/phpCode: ls /usr/local/lsws/ | grep lsphpOur WordPress command: Code: /usr/local/lsws/lsphp83/bin/php /home/cyber.adminslab.com/public_html/wp-cron.php >/dev/null 2>&1Code: >/dev/null 2>&1Step 3: Save and check Click Add Cron, then Fetch Current Cron Jobs. The new job shows up with edit and delete buttons: CyberPanel writes the job into the site user's crontab. You can see the same thing from SSH: Code: crontab -u cyber2602 -l
*/5 * * * * /usr/local/lsws/lsphp83/bin/php /home/cyber.adminslab.com/public_html/wp-cron.php >/dev/null 2>&1Code: no crontab for cyber2602Code: cyber2602Code: public_htmlCode: stat -c %U /home/yourdomain.com/public_htmlTo change a job, use the edit (pencil) button; to remove it, the delete button. If the list looks empty, click Fetch Current Cron Jobs: the page doesn't always load them on its own. Step 4: Turn off the built-in WP-Cron By default WordPress runs its scheduled tasks (publishing scheduled posts, plugin update checks, LiteSpeed Cache image optimization, WooCommerce jobs) when a visitor opens a page. On a quiet site tasks run late; on a busy site the check runs on every page view. With a real cron in place, switch the visitor trigger off: Code: cd /home/yourdomain.com/public_html
sudo -u cyber2602 wp config set DISABLE_WP_CRON true --rawCode: Success: Added the constant 'DISABLE_WP_CRON' to the 'wp-config.php' file with the raw value 'true'.Code: define( 'DISABLE_WP_CRON', true );Code: wp-config.phpDo step 3 before step 4. If you disable WP-Cron without a server cron, scheduled posts and plugin tasks silently stop. Step 5: Prove it works List WordPress's queued tasks: Code: sudo -u cyber2602 wp cron event list --fields=hook,next_run_relativeCode: nowCode: wp_update_pluginsCode: litespeed_task_lqipCode: journalctl -u cron --since "-15min" --no-pager | grep cyber2602To test the command without waiting, run it by hand as the site user, then list the tasks again: Code: sudo -u cyber2602 /usr/local/lsws/lsphp83/bin/php wp-cron.php; echo EXIT=$?
sudo -u cyber2602 wp cron event list --fields=hook,next_run_relativeCode: EXIT=0Code: wp_update_pluginsCode: litespeed_task_lqipOther jobs people add
Common problems
More CyberPanel guides
Tested on CyberPanel 3.0 (build 8, OpenLiteSpeed edition) on Ubuntu 24.04, October 2026. Menu names can change slightly between versions. |