1

I'm having this problem where cron jobs doens't seem to post delayed posts..

I'm using this cron job

wget -O /dev/null http://domain.com/wp-cron.php?doing_wp_cron

Am i doing something wrong?

  • the cronjob will be triggered by wp itself, no need to setup this. "doens't seem to post delayed posts.." find a plugin instead. keyword: fix missed scheduled posts – Jesse Jul 8 '14 at 13:27
  • Found this plugin, will report back if works. wordpress.org/plugins/wp-missed-schedule – dasmikko Jul 8 '14 at 14:44
1

It seems you are using your regular cron for that and it seems you are using the WP cron incorrectly in your example above. If you want to use wp cron in anything, this is the basic usage:

if ( ! wp_next_scheduled( 'wpcron_hook' ) ) {
  wp_schedule_event( time(), 'hourly', 'wpcron_hook' );
}

add_action( 'wpcron_hook', 'delay_myposts' );

function delay_myposts() {
  // put your delay post codes in here
}

Reference: https://codex.wordpress.org/Function_Reference/wp_cron

If in any way that your WP cron is still not firing, this might be in your wp-config.php file

define('DISABLE_WP_CRON', false);

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.