Posted on 1 Comment

Replace WordPress Cron Job with Linux Crontab

If WordPress Cron Job isn’t getting triggered on-time, which is common if the blog does not get a lot of traffic, WordPress cron can be setup to use a real Linux crontab to make it trigger on-time. If you don’t have access to the Linux command line for your server, then ask your webhost to setup this up for you.

In wp-config.php disable WP Cron:

define(‘DISABLE_WP_CRON’, true);

Open a Linux terminal command line window and enter:

crontab -e

Now press the i key to insert a new line and paste the following with your domain name:

0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * wget -q -O - http://www.mydomainname.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Now press the Esc key, and then the keys :wq, and enter, to save your changes.

This will fire the cron every 2 minutes.

1 thought on “Replace WordPress Cron Job with Linux Crontab

  1. A cron job for every two minutes can also be written like this: “*/2 * * * *”.

Leave a Reply

Your email address will not be published. Required fields are marked *

HTML tags are not allowed.

179,821 Spambots Blocked by Simple Comments