The wp-cron.php file can slow down a website, especially if it experiences high traffic. This file runs every time a page is loaded, checking for scheduled posts that need to be published. While this process works well for sites with low traffic, it can become problematic when visitor numbers increase. To address this issue, it’s advisable to set up a server-side cron job instead.
When posts are scheduled, they may not publish at the intended time if there are no visitors to the site, leading to delays. A cron job is essentially a script that executes at specific times, triggering other scripts. For example, it can handle scheduled posts in WordPress.
To transition cron jobs to the server side, the first step is to disable the wp-cron.php file. This is done by editing the wp-config.php file. After locating the database information section, a specific line of code must be added to disable the cron job functionality.
The next step involves finding the hosting username, which can be located in the file manager of the hosting control panel. This username is typically displayed in the file path hierarchy.
Following that, the control panel offers an option to create a new cron job. Here, the user can set the schedule parameters, including minute, hour, day, month, and weekday. A specific command must also be input, which includes navigating to the public_html directory and executing the wp-cron.php script.
For optimal performance, the cron job can be set to run every six hours. This setup will ensure that the scheduled posts are managed efficiently, enhancing the site’s performance during peak traffic times. Once the cron job is created, the website will benefit from improved functionality and responsiveness.
Source Link


