WP 404 Cron Error Solutions

WP can throw cron.php 404 errors under Apache or NginX for to a variety of reasons. Cron runs at every page load, which may a reason for a lot of these. For high traffic sites, it may be best not to have cron running at every page load anyway.

To solve these issues, do the following (See PC Freak for more information):

  1. Disable wp-cron.php’s run on page load.

Insert the following into wp-config.php (/var/www/wordpress/)

/* Disable WP CRON */
 define('DISABLE_WP_CRON', true);
  1. Schedule a wp-cron.php run every fifteen minutes or so – link.
crontab -u www-data -e

### Run WP-Cron every 15 minutes
 */15 * * * * /usr/bin/wget -q "http://www.your-domain-url.com/wp-cron.php?doing_wp_cron"
  1. wp-cron may not run well as a crontab cronjob. I found that it created hundreds of cron logs in the /root folder. Instead, run it under /etc/cron.d, or with a different format – link.
*/5 * * * * wget -q -O - "http://mydomain.com/wp-cron.php" > /dev/null 2>&1

#Sometimes it might be required to run PHP directly:
*/5 * * * * php /home/$USER/public_html/wp-cron.php

#You can also do it using curl:
*/5 * * * * curl -vs -o /dev/null http://mydomain.com/wp-cron.php > /dev/null 2>&1


Photo by takamorry