wp-cron.php is the WordPress task scheduler, that takes care of things like checking for updates and publishing scheduled posts.
It runs on every single page load.
If your website has not been visited in a while, it will have a lot of missed tasks to catch up which can greatly increase the loading time and could cause additional resource usage issues.
If you are using caching plugin or CloudFlare, the scheduled posts may even never get published.
So, how to fix this?
It is super easy.
Step 1) Disable wp-cron at the WordPress wp-config.php
Step 2) Setup wp-cron as a real Cron job within cPanel
This technique will improve the load time of your website and make sure that wp-cron is running a maintenance tasks never mind if anyone has come to your website or not.
Let's get started!
1) Login to your cPanel and open the File Manager:
then go to the Document Root folder of the website:
2) Right click the wp-config.php and select Code Edit:
Right after he opening PHP tag <?php enter:
then Save the to disable the wp-cron within WordPress:
That's it! You have completed Step 1.
Type for Step 2. Go back to your cPanel and to the Cron jobs section:
Before clicking on the Cron Jobs, make sure to copy or remember your cPanel Username, it is outlined at the above image at the Stats section.
Go to Add a New Cron Job, select Common Settings >> Once Per Hour:
At the Command: field type:
/usr/bin/php /home/USERNAME/public_html/wp-cron.php >/dev/null 2>&1
where USERNAME is your cPanel Username and public_html is your website's Document Root and click on Add New Cron Job:
If you have multiple WordPress websites within the cPanel account, we recommend setting up the Cron jobs to run sequentially for every other website:
Each cron will run once an hour, where the first would be at 00:05 o'clock, the second 00:10 o'clock, the third 00:15 o'clock and the fourth: 00:20 o'clock.
More info about Cron jobs? Click here: How to setup a cron job in cPanel
Should you have any further questions or need our assistance in disabling the wp-cron?
Feel free to contact us via the Open Ticket section within your MyKualo client area.