Fix issue missed schedule in WordPress

0
668
Fix issue missed schedule in WordPress
Fix issue missed schedule in WordPress

In WordPress, post schedule is triggered through wp-cron script when someone visits the page; however, if the page has low traffic, the post will not be published in time. In this article, I will show you how to fix issue missed schedule in WordPress.

To fix issue missed schedule in WordPress, you need to do two things:

  • Turn off the WP Cron config.
  • Use server cron job to trigger schedule.

Let’s get started!

Turn off the WP Cron config

To do this, you will need to add a line into wp-config.php to disable the config value:

define('DISABLE_WP_CRON', true);

You can put this line on the top the file along with other define().

Use server cron job to trigger schedule

In WordPress, the cron is triggered through an endpoint:

example.com/wp-cron.php?doing_wp_cron

Therefore, what we need to do is to make an HTTP request call to this endpoint, which can be done using wget or curl or anything that can make HTTP request, for example:

wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Then, we will register this task to system cron.

* * * * * wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

The task will execute every minute. You can change it to whatever value you think is appropriate for your site.

Make sure to replace example.com by your website domain.

As for my blog, I setup the cron job to execute every 15 minutes.

*/15 * * * * wget -q -O - https://blog.petehouston.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Conclusion

Compare to default WordPress cron settings, using system cron will make it more reliable to execute task and of course, posts will be scheduled in time.

With this configuration, you can fix issue missed schedule in WordPress.

Have fun!