Loading...

How to Run Cron Jobs on Cloudways

Cron jobs on Cloudways let you schedule recurring tasks so they run automatically at set intervals. Common uses include clearing WordPress transients, sending automated emails, importing product feeds, running database maintenance scripts, and triggering WooCommerce stock updates without manual action each time.

This guide is part of our Cloudways management and maintenance guide, which covers backups, logs, and scaling alongside cron jobs.

What Is a Cron Job?

A cron job is a Linux-based scheduled task that runs a script or command at a defined time or interval. On Cloudways, cron jobs are managed per application from the dashboard, without needing SSH or editing system files directly. The name comes from cron, the standard Unix time-based job scheduler used across Linux servers.

Cron Schedule Format

Cloudways offers preset intervals in a dropdown: every 15 minutes, 30 minutes, hourly, daily, weekly, and monthly. For a custom schedule, enter standard cron syntax using five space-separated fields:

  • Minute: 0-59
  • Hour: 0-23 (24-hour clock)
  • Day of month: 1-31
  • Month: 1-12
  • Day of week: 0-7 (both 0 and 7 equal Sunday)

Common examples:

  • 0 * * * * runs at the top of every hour
  • 30 3 * * * runs at 3:30 AM every day
  • 0 0 * * 1 runs at midnight every Monday
  • */15 * * * * runs every 15 minutes

How to Create a Cron Job on Cloudways

Step 1: Log In

Log into your Cloudways Platform dashboard using your credentials.

Cloudways dashboard login screen

Step 2: Select Your Application

Click Applications in the top navigation and select the application where you want to add the cron job.

Cloudways top navigation bar with Applications menu

Step 3: Open Cron Job Management

Inside the application settings, find Cron Job Management and click Add New Cron Job.

Cloudways Cron Job Management panel with Add New Cron Job button

Step 4: Set the Schedule and Script Type

Choose your interval from the dropdown or select Custom to enter a cron expression manually. Then choose the script type that matches your command:

  • PHP: runs a PHP file directly. The command path must be absolute, pointing to the script inside your application folder.
  • curl: sends an HTTP request to a URL. Commonly used to trigger WordPress WP-Cron over HTTP.
  • wget: retrieves a URL silently. Functionally similar to curl for most scheduled HTTP tasks.

Enter the command to execute and click Submit. The cron job will appear under the Basic tab, where you can also edit or delete it later.

Cloudways cron job configuration panel with frequency dropdown and script command field

WordPress: Replace WP-Cron With a Server Cron

By default, WordPress uses WP-Cron to handle scheduled tasks such as publishing posts, checking for updates, and sending emails. WP-Cron fires only when someone loads a page on your site. On low-traffic sites, scheduled tasks may be delayed. On high-traffic sites, every page load adds a small overhead check.

Replacing WP-Cron with a real server cron job fixes both problems. To do this:

  1. Open wp-config.php in your application and add define('DISABLE_WP_CRON', true); above the line that reads /* That's all, stop editing! */.
  2. In Cloudways Cron Job Management, create a new cron job using the curl type.
  3. Set the URL to your site’s WP-Cron endpoint. For example: https://yourdomain.com/wp-cron.php?doing_wp_cron (replace yourdomain.com with your actual domain).
  4. Set the interval to every 5 or 10 minutes depending on how frequently your scheduled tasks need to fire.

After setting this up, verify jobs are running as expected by reviewing your Cloudways application logs for errors. You will also need your application folder name on Cloudways when building absolute PHP file paths.

Real-World Cloudways Cron Job Examples

Below are common cron job patterns for WordPress sites on Cloudways, with the schedule syntax and script type for each.

Replace WP-Cron (Every 5 Minutes)

  • Schedule: */5 * * * *
  • Type: curl
  • Command: https://yourdomain.com/wp-cron.php?doing_wp_cron
  • When to use: After disabling WP-Cron in wp-config.php. Ensures scheduled posts, email queues, and plugin tasks fire on time regardless of traffic levels.

Weekly Database Optimization

  • Schedule: 0 3 * * 0 (3 AM every Sunday)
  • Type: PHP
  • What it does: Runs a cleanup script to remove post revisions, expired transients, and auto-draft posts. Plugins like WP-Optimize can be triggered via a curl call to the WP-Cron endpoint instead.

WooCommerce Stock Sync

  • Schedule: */30 * * * * (every 30 minutes)
  • Type: curl or PHP
  • When to use: For stores syncing inventory with an external ERP or warehouse API. Trigger the sync endpoint every 30 minutes to keep stock counts current without manual updates.

Daily Log Rotation

  • Schedule: 0 1 * * * (1 AM daily)
  • Type: PHP
  • What it does: Deletes or archives plugin log files older than 7 days. Cloudways application logs rotate automatically, but custom plugin logs often accumulate without any cleanup.

Troubleshooting Cloudways Cron Jobs

If a cron job is not running or returning errors, check these common causes:

  • Wrong file path: cron does not inherit your shell environment, so relative paths fail silently. Use the full absolute path to the script.
  • Permission errors: the script must be readable by the server user. If cron jobs fail because of permissions, check and reset your Cloudways file and folder permissions.
  • PHP errors in the script: a syntax error or missing dependency causes the script to exit early. Enable PHP error logging on the application and check the Cloudways application logs to capture these.
  • Script timeout: tasks that run longer than the server’s execution time limit will be terminated. Break large jobs into smaller batches or increase the PHP time limit for that application.
  • Duplicate WP-Cron runs: if you set up a server cron for WP-Cron but did not add define('DISABLE_WP_CRON', true); to wp-config.php, scheduled tasks will run twice.
  • Insufficient privileges: only account owners and team members with full privileges can create, edit, or delete cron jobs on Cloudways.

Final Word: Cloudways Cron Job Management

Running cron jobs on Cloudways is managed from the application dashboard in a few straightforward steps. Whether you are scheduling PHP scripts, triggering HTTP endpoints with curl, or replacing WordPress WP-Cron with a server-side schedule, the Cron Job Management panel handles it without SSH. For a full picture of what Cloudways offers, see the Cloudways review.

FAQs

Cloudways cron jobs support three script types: PHP (runs a PHP file using the absolute path to the script), curl (sends an HTTP request to a URL), and wget (retrieves a URL silently). PHP is used for server-side scripts, while curl and wget are commonly used to trigger WordPress WP-Cron or other HTTP endpoints on a schedule.

Yes. Create a cron job in Cloudways using the curl script type and point it to your WP-Cron URL: https://yourdomain.com/wp-cron.php?doing_wp_cron. Before doing this, add define('DISABLE_WP_CRON', true); to your wp-config.php to stop WordPress from triggering its own cron on every page load. Set the server cron to run every 5 or 10 minutes depending on your scheduling needs.

Go to your application in the Cloudways dashboard, open Cron Job Management, and click the Basic tab. All saved cron jobs are listed there. Click the delete icon next to the job you want to remove. Only account owners and team members with full privileges can delete cron jobs.

Cloudways cron jobs can run as frequently as every minute using a custom cron expression. The preset options in the dropdown go as frequent as every 15 minutes. For most WordPress maintenance tasks, every 5 or 10 minutes is sufficient and avoids unnecessary server load.

The most direct method is to check your application logs after the cron job’s scheduled time. In the Cloudways dashboard, go to Application > Monitoring > Application Logs and filter for log entries around the time the job should have fired. If your PHP script writes to a log file, that output appears there. For curl-type jobs (including the WP-Cron replacement), you can also check WordPress’ own scheduled tasks by installing the WP Crontrol plugin, which shows when WP-Cron last ran each scheduled action. If cron jobs run silently with no logged output, add error_log('cron ran at ' . date('Y-m-d H:i:s')); to the beginning of your PHP script to confirm execution.
Yes. Set the script type to PHP and use the full path to the WP-CLI binary and your WordPress installation. The standard pattern is: /usr/local/bin/php /home/master/applications/your-app-folder/public_html/wp-cli.phar --path=/home/master/applications/your-app-folder/public_html cache flush. Replace your-app-folder with your actual Cloudways application folder name. You can verify the WP-CLI path by connecting via SSH and running which wp or which wp-cli. Common use cases include cache flush, database optimization, and plugin updates run on a schedule.
Some of the links on this blog are sponsored links
Newsletter
Stay Ahead in Hosting

Expert hosting tips, reviews, and exclusive deals — delivered straight to your inbox. Join thousands of smart webmasters.

You're in! Thanks for subscribing.
Something went wrong — please try again.
No spam, ever. Unsubscribe in one click.
Top