
Sometimes posts are not published in the time you have set in WP.
You set the day and time and yet your post was not published.
Even if you think it’s a bug, it’s not, it could be because that’s how WordPress works.
WP Cron and how it works
The function to publish a scheduled post is started by a part in WordPress called WP-CRON. For the feature to kick in, something needs to happen on the website. And therein lies the problem!
Your website visitor triggers WP-CRON and then the function runs, so if there are no visitors to your website, wp-cron will not run and no post will be published. So the problem arises on pages with little traffic.
WP-cron also hates other things on your site and starts automatic updates, for example.
Use a custom cron job instead
The best and easiest solution is to run a regular cron job through your web host instead. Then you won’t be dependent on visitors and things will work the way you thought they would.
In the web host, you set a cron job to https://dindoman.se/wp-cron.php that runs every 5 minutes.
You should also add the following line to your wp-config.php to tell wordpress that you are managing cron alongside WordPress
define('DISABLE_WP_CRON', true);
Here you can read more about WP-cron
Leave a Reply