WP-CRON

If you’re running Sublium on your website, we highly recommend setting up the CRON system to ensure smooth operation.

What is CRON and why is it Important?

CRON is a system that allows tasks to be scheduled and run automatically at specific intervals. In simple terms, it’s like a clock that ticks every minute. For this clock to work, it needs a power source – that’s where CRON comes in. This power source could either be inside WordPress or on the server itself. Having it on the server is preferred because it offloads the task from WordPress, improving the overall performance of your website.

Many web hosting providers are familiar with CRON’s performance benefits and will assist you in setting it up.

Benefits of Setting Up CRON

By setting up CRON, tasks can be executed asynchronously, meaning they’ll run in the background without affecting your website’s speed. This prevents any delays in important processes and ensures that your website operates efficiently.

Cronjob Dependent Tasks:

  • Subscription renewals processing
  • Dunning retries
  • Sending timely emails (payment recovery, renewal notifications, and card expiry notifications)
  • Export data
  • Updating subscription analytics daily

Set Up a Real Cron Job

You can set up a real cron job on your server for tasks like scheduled posts, backups, or any process that requires WP-Cron to run even without visitors.

For Linux Servers:

  1. Log in to your server via SSH.
  2. Edit the crontab file by running the command:
    crontab -e
  3. Add the following line to run WP-Cron every 15 minutes:
    */15 * * * * curl --silent --output /dev/null https://yourwebsite.com/wp-cron.php?doing_wp_cron
  4.  Replace yourwebsite.com with your actual domain name.
  5. Save and close the crontab file.

For cPanel:

  1. Log in to cPanel(your hosting service provider’s admin panel).
  2. Go to Cron Jobs.
  3. Add a new cron job to run every 15 minutes with the following command:
    curl --silent --output /dev/null https://yourwebsite.com/wp-cron.php?doing_wp_cron
  4. Replace yourwebsite.com with your actual domain name.
  5. Save and close.

How to Set Up CRON Using an External Service?

Sometimes, your hosting server may not run CRON properly. That’s why it’s good to have a backup.

Here you can use two services to set up CRON jobs:

  • Service-1: Create a free account and set up with Cron-job
  • Service-2: Use a paid service with EasyCron

Let’s use the first service and show you the step-by-step process:

Step 1: Create a CRON job

Once you’ve registered or logged-in to your account, follow these steps to set up CRON.

  1. Click on the “CREATE CRONJOB” button.
  2. Enter the title and cron job URL provided below.
    https://yourwebsite.com/wp-cron.php?doing_wp_cron
  3. Replace yourwebsite.com with your actual domain name

Step 2: Configure the CRON job execution schedule

Configure the execution schedule to run every 15 minutes.

Let’s run it for only 15 minutes.

For that, set the schedule to expire and set the time.

Once done, click on ‘Create’.

Clicking on the Create button will create the CRON for auto-execution.

This is how you can set up a cron job using an external service. Alternatively, you can use the EasyCron service to set up the CRON job; however, it is a paid service.

By following these steps, you should be able to identify and resolve any issues preventing WP-Cron jobs from running properly on your WordPress site.

In any case, it’s always best to set up the cron at the server level. We recommend you contact your service provider to set up the CRON URL on the server.

Ready to Transform Your Subscriptions?

Join a growing community of WooCommerce store owners who rely on Sublium to power their recurring revenue.
Sublium WooCommerce subscription plugin support team - expert help and guidance
5 star rating from Sublium WooCommerce subscription plugin customer
Transform WooCommerce subscriptions with Sublium - superior plugin alternative