How to setup cron for auto feed update?

WordPress Cron only triggered when a visitor visits your site. For example, you have set the feed update 10 hours interval. So until a visitor visits your site the feed update Cron Job will not run. For this reason, you have set a Cron Job from your CPanel or Server or any other third-party Cron Job service like to hit the Cron Job URL for Auto-update your Feeds 

Cron Job URL:

Step 1:

 Go to Woo Feed>Manage Feeds and update the interval. 

Manage Feeds and update the interval

Step 2:

For cPanel Configuration #

Auto Feed Update cron configuration

Common Settings: This drop-down contains commonly used time settings for Cron Jobs. You can choose one of these options to set how often your Cron Job will run. If you select a setting from this menu the rest of the time settings will be filled in for you automatically.

Custom Timing: Here you can customize how often your Cron job will run. If you chose a common Setting option from the first drop-down these will be filled in automatically for you and you can skip them.

Command: Here you need to enter the command you want the Cron job to run. This can be a simple shell command or you can run a script.

wget -q -O - >/dev/null 2>&1

For Mac OS X and Linux #

Mac OS X and Linux both use Cron as their time-based scheduling system. It is typically accessed from the terminal with the

crontab -e

command. It should be noted that tasks will be run as a regular user or as root depending on the system user running the command.

Cron has a specific syntax that needs to be followed and contains the following parts:

  • Minute
  • Hour
  • Day of month
  • Month
  • Day of week
  • Command to execute
command to execute

If a command should be run regardless of one of the time sections an asterisk (*) should be used. For example, if you wanted to run a command every 15 minutes regardless of the hour, day, or month it would look like:

15 * * * * command

Many servers have wget installed and this is an easy tool to call the Cron script.

wget -q -O - >/dev/null 2>&1

A daily call to your site’s Cron Job that triggers at midnight every night could look similar to:

0 0 * * * wget -q -O - >/dev/null 2>&1

For Windows #

Windows call their time-based scheduling system the Task Scheduler. It can be accessed via the  Administrative Tools in the control panel.

How you set up the task varies with server setup. One method is to use PowerShell and a Basic Task. After creating a Basic Task the following command can be used to call the WordPress Cron script.

powershell "Invoke-WebRequest"