How do I set up a cron job in StackCP

Author:

Published:

Updated on November 21, 2025

Reading Time: 2 min

What is a Cron Job? Think of a Cron Job as a scheduled timer for your website. It allows your site to automatically perform important tasks—like checking for updates, sending emails, or backing up your data—at specific times, without you having to do anything manually.

How to Set One Up in StackCP You can easily set these up through your hosting control panel.

  1. Log in to your StackCP dashboard.
  2. Go to the Web Tools section and click on Scheduled Tasks.
  3. Here, you will see three main options to configure:
    • The Command: This is the specific task you want the server to run (usually a script file). Note: If you are running a PHP script, make sure to select the correct PHP version for your site using the dropdown on the right.
    • The Schedule: Choose how often the task should run (e.g., every 15 minutes, once a day, etc.) using the dropdown menus.
    • Email Notifications: You can enter your email address to be notified when the task runs. (You will only get an email if the task produces a system message or “output”).

For WordPress Users: Improving Reliability #

By default, WordPress uses a system called “WP-Cron” to handle its scheduled tasks (like publishing scheduled posts). The problem is that WP-Cron only works when someone visits your website. If nobody visits your site for a while, your scheduled posts or backups might not happen on time.

Why Switch to a Real Cron Job?

  • Reliability: Tasks run exactly when scheduled, regardless of your website traffic.
  • Performance: It offloads the work from the visitor experience to the server.

How to Make the Switch

  1. Disable the default WordPress trigger: Open your wp-config.php file and add this line of code: define('DISABLE_WP_CRON', true);
  2. Set up the task in StackCP: Go back to the Scheduled Tasks section in StackCP and create a new task to trigger your WordPress system manually (setting it to run every 30 minutes is a common standard).