To handle scheduled tasks, you need to set up cron job via cPanel.

First, you need to disable the file to be hit every time someone loads your pages. To do this, open the wp-config.php file in your website folder and add this line at the end, before the closing ?> tag:

define('DISABLE_WP_CRON', true);

 

Then you can set up cron via cPanel. Open cpanel and find there Cron Jobs section.

cron_job

When you open it, there will be offer to set up an email sent to you each time when cronjob is executed successfully. You can add your email just to be sure that it works ok.

Below you will see a list of preset intervals. Select Every 30 minutes from the minutes drop-down and leave a * symbol in the rest of fields.

Add command below where /user/ must be your cPanel username.

/usr/local/bin/php /home/user/public_html/wp-cron.php

cron_setup_estatik_rets

Click on Add new Cron Job button. You will see this cron job in a list of cron jobs which can be removed or edited.

POSTED IN BLOG June 2, 2017 0 REPLY