Configuring a custom Cron job in WordPress Using Command line.

To set up a WordPress cron job using the command line, follow these steps:

  1. Log in to your account using SSH.
  2. At the command prompt, type the following command:

crontab -e

  1. Type o to enter editing mode and start a new line of text.
  2. Type the following line, replacing username with your own cpanel account username:

*/30 * * * *  cd /home/username/public_html; /usr/local/bin/php -q wp-cron.php

NB:This line sets the cron job to run every 30 minutes.

  1. Press Esc, type : wq and then press Enter. The new cron job settings take effect immediately.

Was this article helpful?

Related Articles

Leave A Comment?