How to Troubleshoot WordPress Scheduled Post Not Publishing pt. 2

I’m still in the process of gathering more information on the subject, but I did manage to find what could be the another source of the same problem. Please read through the symptoms part of the previous post to see if this is your case. But to put simply, when your website uses a cache plugin and fails to show a scheduled post, even though the post is published on the dashboard, it is likely caused by the said cache plugin not purging (or updating) the caches of the website after the scheduled post came online.

Solutions

This solution is rather a brute attempt, but there is no reason why it shouldn’t work. If the cache is not being purged because the WordPress has not seen a visitor, we can create a ‘visitor’ for WordPress at timely manner.

Because this solution uses Cron, if your hosting service provider does not have a scheduler assistant of sort, I recommend using a generator, otherwise give the man page a good read before dialing it in. For example, this is the schedule expression for 4:15 AM every weekday: 15 4 * * 1-5. There are online generators available, feel free to grab any of them.

On the cPanel of your hosting service, it should offer a way to run cron. Add a following job with the schedule of your choice and the url of the website:

[schedule expression] wget --delete-after [url of website]/wp-cron.php?doing_wp_cron

The cron job will trigger at the time dictated by the schedule expression. This will act like having a ‘visitor’ for the website, and force WordPress to update. However, reading the WordPress’ own documentation on wp-cron, it seems cron job is queued (unlike the Unix cron) and will run “eventually”. It appears to be more prudent to have it run more than once a day. Some of the cache plugin documentations even suggested running it every 15 minutes.

note Nov 8, 2024: I found the most common practice to fix wp-cron problem is to have it replaced with Linux cron. Please do check out the related post.

Comments

Leave a comment