Please visit Cron Job: Basics & Checklist to learn about FluentCRM’s scheduled events, basics, and more information first.
In the Cron Job: Basics & Checklist guide, we have seen the importance of configuring a Cron Job for a WordPress Website to ensure that the scheduled jobs run timely and successfully and do not fail the scheduled jobs or events and everything works in order. This includes running FluentCRM Email Processing, Sending, Running Automation, Email Sequences, and other processing tasks.
Before we begin, please make sure that you have read about the Cron Job: Basics & Checklist and event recurrences of FluentCRM and also followed Disable Default WordPress Cron System with the code below:
/* Add any custom values between this line and the "stop editing" line. */ define('DISABLE_WP_CRON', 'true'); // Disable the default PHP-based Cron invocation. /* That's all, stop editing! Happy publishing. */
Cron Jobs or Scheduled Jobs can be run or invoked locally and remotely. In this article, we will learn about the recommended and most effective method for configuring a cron job for a WordPress Website. We also have a few articles focused on running cron jobs remotely:
Configure WordPress Cron Job from cPanel #
One of the most used and popular Web Hosting Control Panels is cPanel and we will be evaluating it in this article.
Find WordPress Installation Directory #
We need to find the WordPress Installation directory first where the Cron Script wp-cron.php file is located and will be needed in the further steps. You can find your WordPress Installation Directory easily by going to WordPress Dashboard ⮕ Tools ⮕ Site Health ⮕ Info Tab ⮕ Directories and Sizes Section. More about this can be found here: Find WordPress Installation Directory
Identifying Cron Command #
From our cPanel-hosted website, we got the WordPress Directory as below:
The WordPress Cron path is:
Cron Settings #
Now please go to the Cron Jobs option as shown below:
This will offer some input fields to set the Cron Intervals and the Cron Command as below:
Most of cases, the suitable recommended time interval for running the Cron job is per minute. Putting a Star(*) means EVERY. Here all 5 stars mean Every Minute on Every Hour on Every Day on Every Month on Every Weekday.
The command for running WordPress is including the PHP Binary:
And the total command including time intervals which is the resulting final output is:
* * * * * /usr/bin/php /home/regiktux/ibrahimsharif.com/wp-cron.php
Discarding Cron Command Output #
As we just run the command it showed us an output that we do not need or should discard through running the Cron Job. Our Original Command is:
Now we can discard the output by sending the output to NULL adding /dev/null 2>&1 to the end. The final command including time intervals is:
Please use your own Paths and Paramaters obtained from your hosting as guided here.
* * * * * /usr/bin/php /home/regiktux/ibrahimsharif.com/wp-cron.php > /dev/null 2>&1
This does not output anything but does the job silently as shown below:
Compare Cron Status #
When the cron configuration is completed we should check back after one or more hours from the FluentCRM Settings > Tools and compare our results against the below screenshot which is a normal FluentCRM Cron Status running 3 events on 1 Minute, 5 Minutes, and 1 Hour Intervals.
That’s all for cPanel WordPress Cron Configuration! Thanks and enjoy working with WordPress Scheduled Events.