4

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?
  • How many sites do you have? And yes, you need to hit each sites cron but you don't want to add the doing_wp_cron params. – jgraup Nov 2 '16 at 13:18
2

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.

| improve this answer | |
  • 1
    Can you explain a little bit please? – bravokeyl Nov 2 '16 at 12:09
  • ?doing_wp_cron=date +\%s is useless because i have varnish cache and unique uri is essential! – ar099968 Nov 3 '16 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.