Nội dung
Fixing the error of not posting posts when scheduling on WordPress with 3 steps.
Introduction
Sometimes you may have a situation where the post is scheduled to be published, but the post is not published by that time. This problem is usually related to the following reasons:
- Website time and system time (Host/VPS) are different.
- Cron Jobs processor of WordPress is not working.
This problem is often encountered in case 1 up to 80% and often occurs on VPS services because when using VPS, users will be able to customize the time zone according to each region of the world. Therefore, if the time set up on the website and the time in the system are not the same, the posting schedule will be wrong, or the error cannot be published.
Below is an illustration of a case where the website time (18:47) and the system time (11:47) do not match, resulting in the post not being published automatically when scheduled. If you use Hosting and want to check the system time, you just need to go to Host >> Terminal and type date
to see the system’s time, if it’s wrong, you need to contact your hosting provider to process it.
Implementation Guide
AZDIGI will guide you through a step-by-step check so that we can identify the problem and fix it.
Case 1: Check and process time zone
Step 1: Check system time and website time
As in the example above, after checking the time of the VPS and the website, the two time zones are completely different, so first I will edit the time zones to match.
I’m in Vietnam and will choose the Vietnam time zone, specifically Ho Chi Minh City, now in Vietnam, the time is 18h50, but on VPS, it is 11h50, which means the time on VPS is slower than 7 hours.
Now I will proceed to update the time zone on the VPS to be the same as the time zone of the website according to step 2.
Step 2: Update system time
You can view the time zone and update the Vietnam time zone for VPS with the commands:
timedatectl status ### Xem thông tin múi giờ timedatectl set-timezone "Asia/Ho_Chi_Minh" ### Set múi giờ Việt nam cho VPS
After processing, please check the website’s posting schedule to see if it has been processed. And in my case, after updating the time, I have successfully scheduled the post.
Case 2: Checking WordPress Cron Jobs
Step 1: Check if Cron Jobs is blocked
If in case 1, your time zone is correct but still cannot be handled, then you should check the Cron Jobs section of WordPress to see if it is being blocked or not because if this feature is blocked, it means that the settings related to autorun will not work.
To check, open the wp-config.php file at the Document Root path of the website to see if there is a paragraph below, if so, then proceed to # or delete that line for Cron Jobs to work properly.
define('DISABLE_WP_CRON', 'true');
If you have proceeded this part and it still does not work, do not worry, please continue to step 2.
Step 2: Install the Scheduled Post Trigger plugin
The way this plugin works is that when someone visits your website, it immediately checks if WordPress has missed any recently scheduled jobs. If the Plugin finds a job missed, it will repost it for you. To make it easier to understand, this Plugin will be a tool to check the periodic activities related to WordPress Cron Jobs.
You just need to install and activate the plugin to use, and you don’t need to customize anything else.
Thus, AZDIGI has shown very simple ways to handle the error of not posting posts when scheduling on WordPress that you can refer to. Hope you can take it successfully if you encounter a similar situation on your WordPress website.