{"id":931,"date":"2012-12-20T10:39:25","date_gmt":"2012-12-20T20:39:25","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=931"},"modified":"2012-12-20T10:39:25","modified_gmt":"2012-12-20T20:39:25","slug":"wordpress-cron","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/wordpress-cron\/","title":{"rendered":"WordPress Cron"},"content":{"rendered":"
A great way to take more control of your wp-cron and also slightly speed up wordpress is to disable cron and scheduled a cron job on your server to run wp-cron.php. \u00a0You just need a server that supports cron jobs.<\/p>\n
In wp-config.php add:<\/p>\n
define(‘DISABLE_WP_CRON’, true);<\/p>\n
Be careful though, sometimes this has a negative effect on your website. \u00a0For example if you have subscriptions from woocommerce, each user’s subscription is checked on every 12 hours. \u00a0If you have a ton of users, each of these users has a cron job waiting to run throughout the hour. \u00a0These jobs will slow down your server if you run wp-cron too far apart.<\/p>\n
Setting up your cron command can look similar to:<\/p>\n
*\/30 * * * * wget http:\/\/example.com\/wp-cron.php?doing_wp_cron > \/dev\/null 2>&1<\/p>\n
<\/p>\n