Reasons for scheduled publication and automation tasks to stop: WP-Cron and server cron
- The real reason why scheduled posts are delayed is due to the visitors.
- Reasons why automation stops after changing the domain.
- If precise timing is required, a server cron job is a better option.
- The difference between the two methods lies not in the reservation list itself, but in the entity that initiates the process.
- Even if you switch to a server cron job, it can still fail silently.
- What should I choose for my website?
- Dividing the migration scope using LUX Content Migration.
- Frequently Asked Questions.
- WordPress-related links
If a post scheduled for 2:00 PM is not published until 5:00 PM, it may not be because the post is long. WordPress’s automated tasks do not run automatically like a clock; they require someone to initiate them.
That “someone” could be a visitor, or it could be the server’s clock. The key to distinguishing between a WP-Cron issue and a server cron issue, especially when scheduled tasks and plugin operations stop, lies precisely in this.
The real reason why scheduled posts are delayed is due to the visitors.
Scheduled posts, plugin updates, email sending and backups, and cleanup tasks must be performed at specific times. In WordPress, these tasks are included in a scheduled list called cron events.
However, WP-Cron is not a clock that continuously runs on the server. Instead, it is a mechanism where WordPress checks for scheduled tasks and initiates their execution when a page is accessed.
Therefore, even if there is something to be done at 2:00 PM, if the next visit occurs at 5:00 PM, it can be handled then. This is why the delay in scheduled publication cannot be attributed solely to the content or the editor’s mistake.
On websites with a high volume of visitors, delays are less noticeable. Conversely, on websites with infrequent visits, it may appear that nothing is happening even after the scheduled publication time.
Without visits, the execution will also be delayed.
Reasons why automation stops after changing the domain.
After a domain change or server migration, the website may open normally. However, there may be cases where only scheduled posts and automatic tasks performed by plugins are stopped.
At this time, the migration task and any related automation call issues must be checked separately. LUX Content Migration uses role settings to distinguish between the existing site and the new site, and it exports or imports selected posts, pages, categories, comments, authors, custom fields, and media files into dedicated files.
Using “content only” allows you to transfer only the necessary content, which is useful for first dividing and verifying the migration scope. However, the wp-cron.php call and the loopback request after the transfer must be checked separately.
At this time, WordPress attempts to access the wp-cron.php file on its own website to trigger the task. This type of request, where a website sends a request to itself, is called a loopback request.
The problem is that even if the new address opens on the screen, it may appear differently on the server. The previous address may still be present, the HTTPS authentication may not be correct, or authentication and firewalls may block the request.
The official WordPress documentation also advises checking for loopback request failures if time-based tasks are not being executed. If the site health check test targeting wp-cron.php fails, you should examine the execution path of the automated tasks.
In other words, simply because a visitor is detected does not automatically mean that the entire system, including the automation features, is functioning correctly. While a guest may enter through the front door, the wiring for the internal call bell system might be disconnected.
Even if the page opens, the automation can be stopped.
If precise timing is required, a server cron job is a better option.
In short, it’s like this: If a website can tolerate a few minutes of delay, WP-Cron is sufficient, but for websites where a specific time is critical, a server cron job is more reliable.
The server cron calls wp-cron.php at intervals determined by the server’s clock. This means that WordPress scheduled events can be triggered regardless of whether there are any visitors.
If a website has a strict requirement for scheduled publication time, the method where the server directly triggers the process is more suitable than a system that makes visitors wait. The same judgment can be applied in cases such as order processing or backups, where delays can lead to losses.
However, you must not disable WP-Cron without also connecting the server cron. This is like dismissing someone without replacing them, which completely stops the automated tasks.
Simply disabling WP-Cron will not resolve the issue.
The difference between the two methods lies not in the reservation list itself, but in the entity that initiates the process.
WP-Cron and server cron do not have completely different lists of scheduled tasks. The biggest difference lies in when those lists are checked.
- WP-Cron: A page visit triggers the task.
- Server Cron: The server’s scheduled execution triggers the task.
- WP-CLI: You can check the scheduled tasks and execution status using commands.
By using the `wp cron event list` command in WP-CLI, you can view the name, next execution time, and recurrence period of scheduled tasks. If there are no tasks listed, simply changing the execution method will not resolve the issue.
Tasks that have passed their execution time can be manually run using the `wp cron event run –due-now` command. The results of this command can provide clues to help identify the cause of the problem.
If an event appears in the list but does not execute, suspect the calling path or an internal WordPress error. If the list itself is missing, it is possible that the plugin has not registered the task, or there is a problem during the registration process.
The method of waking tasks is meaningful only when there is a list of scheduled tasks.
Even if you switch to a server cron job, it can still fail silently.
The server cron is not a universal solution. If the target address is incorrect, or if the server cannot access the wp-cron.php file at the new address, it will repeatedly fail at the scheduled times.
Even if there are internal errors in WordPress due to plugin or theme conflicts, the same issue can occur. The only difference is that the method of waking it up has simply been changed from the visitor to the server, but the part that handles the work after it wakes up remains faulty.
There are cases where reservation events are duplicated or registered with incorrect values. WordPress explains that such duplicate events can cause problems with reservation information and database performance.
The biggest stumbling block when checking directly is trying to fix different problems all at once. If you handle the domain address, loopback requests, whether events exist, and plugin errors simultaneously, you can no longer determine what the cause was.
Especially after a migration, it is dangerous to disable WP-Cron prematurely. If you disable the existing calls before verifying that the new address is being called, the screen may appear normal, but all scheduled tasks will be stopped.
Automation problems are difficult to fix all at once.
Therefore, when performing a direct inspection, it is safe to first check for loopback requests in the site’s status, then verify if events are registered using WP-CLI, and finally, manually execute past events. If it still fails after that, you should separately check the domain and HTTPS settings, authentication and firewall configurations, and potential conflicts between plugins or themes.
What should I choose for my website?
The choice often depends on how much delay one can tolerate, rather than the number of visitors to the site. If visits are consistent and a delay of a few minutes in publishing scheduled posts is acceptable, then WP-Cron can be maintained.
In such cases, first, check for loopback errors in the site’s status and verify whether the scheduled event has actually been registered. If the event exists, check the execution time and the calling path.
If visits are infrequent or timely execution is important, it is better to configure regular execution using a server cron job or WP-CLI. First, ensure that the wp-cron.php call is functioning correctly, and then disable WP-Cron triggered by regular visits. This approach is safer.
If you have recently changed the domain or migrated the server, do not change the settings immediately. First, verify that `site_url` points to the new address, that the server is accessing the `wp-cron.php` file at the new address, and that authentication, the firewall, and HTTPS are not blocking the requests.
If visits are infrequent and you can tolerate delays, then maintain the WP-Cron system.
If timeliness is critical or delays can lead to losses, connect the server to a cron job.
Ultimately, the answer to the question is simple: WP-Cron is suitable for regular websites that receive visits, while server cron is suitable for websites that need to run tasks on time regardless of the number of visits.
Dividing the migration scope using LUX Content Migration.
When changing a domain or server, it is necessary to separately verify what data needs to be moved and whether the automation functions correctly at the new address. LUX Content Migration allows you to specify the current site as either the original site or the new site using role settings, and then transfers the selected content through the export and import functions. Posts, pages, categories, comments, authors, custom fields, and media can be selected in the “Content only” option.
If you only need to transfer the General, Reading, and Discussion settings, permalinks, widget placement, and menu structure, and not the content itself, you can use the “Site settings only” option. In the Import screen’s Preview, you can check the posts and comments that will be created before importing, as well as the number of required images. Completed categories can be reverted using the “Roll back” option. Rules for redirecting from the old address to the new address, and 404 records, are managed separately in the Redirect management add-on.
After organizing the migration scope in this way, the site_url, HTTPS settings, authentication, firewall, and access to wp-cron.php of the new site must be checked separately. LUX Content Migration is a tool for moving WordPress content and settings; it is not a tool for diagnosing or correcting errors in automated tasks.
Frequently Asked Questions.
Q. If the reservation issuance is delayed, can it be immediately determined that it is a problem with WP-Cron?
A. It is not possible to make a definitive conclusion immediately. You must check the following in sequence: the WP-Cron call path, the presence of loopback requests, the existence of scheduled events, and potential conflicts with plugins or themes.
Q. After changing the domain, what should be checked first?
A. Verify that `site_url` points to the new address. Subsequently, check whether the server can access the `wp-cron.php` file at the new address, and ensure that authentication, the firewall, and HTTPS are not blocking the requests.
Q. Can this problem be easily solved using a tool? What kind of tool should be used?
A. Site status checks can identify loopback errors, and WP-CLI can be used to check the list of scheduled events and past events. However, these tools do not automatically fix errors within the events themselves or address address configuration issues.
Q. When changing the domain, is it necessary to perform both content migration and a WP-Cron check?
It is safer to plan together, but not to treat them as the same problem.
After migrating site settings such as content and permalinks to a new WordPress site using LUX Content Migration, it is necessary to separately verify the access to wp-cron.php at the new address and any loopback requests. Simply completing the migration does not guarantee the proper execution of scheduled tasks.