Fli
09-27-2015, 01:43 PM
WP-CRON.php is making sure emails are sent out, scheduled posts are published, updates are checked etc.
This script can take a long time on big sites so this is my treatment:
I added following line into wp-config.php (below "<?php")
define('WP_CRON_LOCK_TIMEOUT', 900);
in aim to do not allow wp-cron to run more frequently than each 900 seconds
I setup cronjob to kill wp-cron.php process every midnight so there is no indefinatelly running wp-crons
52 23 * * * root pkill -f "wp-cron.php"
this line i added into file /etc/cron.d/myjobs which have 0600 permissions and root:root
---
It is also possible to disable wp-cron from within wp-config.php by adding:
define('DISABLE_WP_CRON', true);
and then setting up cronjob to run wp-cron manually:
wget -q -O – http://yourdomain.tld/wp-cron.php?doing_wp_cron >/dev/null 2>&1
This script can take a long time on big sites so this is my treatment:
I added following line into wp-config.php (below "<?php")
define('WP_CRON_LOCK_TIMEOUT', 900);
in aim to do not allow wp-cron to run more frequently than each 900 seconds
I setup cronjob to kill wp-cron.php process every midnight so there is no indefinatelly running wp-crons
52 23 * * * root pkill -f "wp-cron.php"
this line i added into file /etc/cron.d/myjobs which have 0600 permissions and root:root
---
It is also possible to disable wp-cron from within wp-config.php by adding:
define('DISABLE_WP_CRON', true);
and then setting up cronjob to run wp-cron manually:
wget -q -O – http://yourdomain.tld/wp-cron.php?doing_wp_cron >/dev/null 2>&1