How to enable & Configure WP-Cron

January 2, 2017

Parallel processing is one of the ways to get things done at a faster pace. WP Ultimate CSV Importer 5.0 has been recently released with faster import performance. The featured images from external URL are uploaded parallely with the help of Cron in the background to make the import faster.

Featured image import

By default the WP Cron is enabled because there are WordPress features that rely on to execute scheduled jobs. If in case the cron is disabled, you can also enable WP-Cron by editing wp-config.php file in your WordPress root folder and add the following line in the file.

define(‘DISABLE_WP_CRON’, false);

Hooking WP Cron in task scheduler

WP Cron doesn’t run continuously and to run the tasks in the time of import, you can set up the system task scheduler to run on the intervals. If you also have a high traffic website you can trigger the WP-Cron only at the time of your CSV import.

Windows:

In Windows, you can schedule the tasks in Task Scheduler. All Programs → Accessories → System Tools → Task Scheduler.

Cron Entry in Windows

You can trigger the Cron to execute in number of different ways, one of the method is to use PowerShell via cmd.exe.

powershell “Invoke-WebRequest http://Your_Site_URL/wp-cron.php”

Mac/Linux

Both Mac OS and Linux use Cron as time based scheduling system. You can simply execute via terminal.

Users-MacBook-Pro:~ user$crontab -e

If you want to run regardless of the time sections, you can mention with Asterisk(*)

* * * * * wget http://Your_Site_URL/wp-cron.php

If you need to run your import every 2 hours regardless of the day or month, you need to specify like

* 2 * * * wget http://Your_Site_URL/wp-cron.php

Cron Entry

Now you are completely done with your Cron setup and the featured image gets populated parallely with your content import. The Cron entry setup differs for each hosting provider. You can write to us for any assistance at [email protected] or please leave your feedback in the comments below.