For migrating the scheduled tasks to cPanel you need to access WordPress Manager by SuperHosting » Cron Jobs (WP-Cron) and click on Move.
If you want to move back the execution of tasks to the WordPress, use the option “I want WP-Cron to be executed on every request“.
Read on to understand why it is not advisable WP-Cron to run on every request.
What are Cron Jobs and How They Work in WordPress?
Cron jobs are scheduled tasks that are mainly used for managing and maintaining different applications. They can enable regular backup, system monitoring, running scripts, optimizing databases, clearing cache and many more.
Cron Jobs can be run periodically at fixed times, dates, or intervals. If you wish for a certain command to be executed every day, month or year, you should use cron jobs.
On Unix/Linux based systems you can create scheduled tasks through the cron software utility.
WordPress has its own job scheduler which is similar to cron app engine, but it is called WordPress Cron (API).
Information for WordPress Cron API and functions used for cron jobs creation are available in the /wp-includes/cron.php file. The wp-cron.php file is used to run and execute scheduled tasks and their related actions.
There are two types of cron jobs: tasks that are set for a certain interval or performed at a specified time.
Fixed interval tasks might be:
- checking the WordPress version/for available system updates;
- checking for available plugin and theme updates;
- database optimization;
Tasks, performed at a specified time might be:
- publishing an article at a specific time;
- pre-scheduled email sending at a specific hour;
A WordPress Cron Job gets activated when the website is visited by a user. A job check is triggered and then a task is performed even if the scheduled time has passed. When a certain task is scheduled for a specific hour and the website is not visited by anyone, the task is not performed on time.
Checking, activation and executing the task happens when a page is loaded because a user is visiting it.
If there are WordPress cron jobs that are more complex, have resource intensive actions, this could affect negatively the performance of the site. The slowdown will be especially noticeable by the user who triggered the execution of the given cron job.
In such cases we recommend moving the Cron Jobs from WordPress to cPanel.
This article is about: hosting services with cPanel и WordPress Manager by SuperHosting