Cron setup

Needed for LabelGrid API sync and Spotify pre-save functionality.

What is a Cron Job?

cron is a Linux utility which schedules a command or script on your server to run automatically at a specified time and date. A cron job is the scheduled task itself. Cron jobs can be very useful to automate repetitive tasks.

LabelGrid Sync and Spotify pre-save requires you to setup a custom CRON on the server hosting your WordPress site.

Why do I need to manually configure a CRON?

Scheduled tasks are necessary for this plug-in, and because WordPress has to work on all sorts of different platforms, OS’s, and configurations, it cannot assume that your host will natively provide support for a cronjob service that can handle scheduled tasks. This is why WordPress developers have created a workaround – the wp-cron.php file in your main WordPress folder. This script is executed every time someone loads a page. It then checks if there's a scheduled task to be done and executes it if necessary.

To allow LabelGrid Tools to work at the fullest capacity and avoid issues, we recommend you manually configure CRON. Not doing so could bring unexpected errors.

Cron settings depends on your hosting provider. In this documentation we use a cPanel-enabled hosting provider as an example scenario.

Configure your CRON

NOTE: This example is relevant to cPanel. If you are familiar with your server's shell, and your host allows native cron jobs, you can also do the same setup using the cron settings below.

  1. Edit the file /wp-config.php then add the following line: define('DISABLE_WP_CRON', true);

  2. Go to your host's cPanel, and look under Advanced > Cron jobs and add a new cron task: wget -q -O - https://YOURDOMAIN.COM/wp-cron.php?doing_wp_cron=1 > /dev/null 2>&1

The Cron jobs tool has some of the most common schedules preset, so you can just select Every minute from the common settings or use “*” symbol in all the fields.

You need to replace YOURDOMAIN.COM with your actual domain name.

Verify the CRON

We suggest to install a plugin such as Advanced Cron Manager to check that the Cron Jobs are executed correctly.

Last updated