I have a single wordpress with multisite config enabled:

define( 'WP_ALLOW_MULTISITE', true );

I want disable internal cron in wp-config.php with:

define('DISABLE_WP_CRON', true);

My multisite installation is a path-based network, eg.:

http://www.foo.com/bar/
http://www.foo.com/baz/
http://www.foo.com/foo/

In my crontab -e I have:

*/10 * * * * curl -A "crontab" -X POST "http://www.foo.com/wp-cron.php?doing_wp_cron=`date +\%s`" > /dev/null 2>&1

My two questions are:

  1. I have todo a single cron for each path, eg:
*/10 * * * * curl -A "crontab" -X POST "http://www.foo.com/bar/wp-cron.php?doing_wp_cron=`date +\%s`" > /dev/null 2>&1
*/10 * * * * curl -A "crontab" -X POST "http://www.foo.com/baz/wp-cron.php?doing_wp_cron=`date +\%s`" > /dev/null 2>&1
*/10 * * * * curl -A "crontab" -X POST "http://www.foo.com/foo/wp-cron.php?doing_wp_cron=`date +\%s`" > /dev/null 2>&1

or all they need is just one to the root eg.:

*/10 * * * * curl -A "crontab" -X POST "http://www.foo.com/wp-cron.php?doing_wp_cron=`date +\%s`" > /dev/null 2>&1
  1. I see in the apache access.log, wordpress cron uses POST method. Is important to use POST or I can use GET?

1 Answer
1

For Q1 – One for each path / site. Each site has its own cron (jobs) internally. So, it is possible to fine-tune the frequency. For example, a low-traffic site may not have lots of cron jobs. So, the cron could be executed less frequently than a site that requires frequent updates.

For Q2 – You may use GET method. Also, instead of cron command, we may use a simple wget too. The query string “doing_wp_cron” is optional. A simple way to trigger WPCron is…

wget http://example.com/wp-cron.php

You may know about how everything fits together in the official developer documentation for WP Cron.

Tags:

Leave a Reply

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