Cron Draining Memory
WordPress comes equipped with a built-in scheduling system known as wp-cron, designed to execute time-sensitive tasks like update checks, publishing scheduled posts, generating routine backups, and sending triggered emails.
Frequent wp-cron checks could potentially affect overall website performance with regard to memory resources. A solution to this is to disable wp-cron via the wp-config file and set a cron job via the cPanel, as explained below.
1st Step: disable WP-cron
To deactivate wp-cron within the wp-config.php file, start by editing the wp-config.php file. If uncertain, be sure to create a backup beforehand.
Open the file using any text editor and locate the section below:
/* Add any custom values between this line and the "stop editing" line. */
and add the following below:
Then save file
2st Step: setup a cron job
Now go to your cPanel and under advanced, find cron jobs.
Find the section Command (see image to the right) and enter the following code, replacing your domain.com with your actual domain:
wget -O /dev/null https://yourdomain.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
Then click common settings at the top and select twice per day from the drop-down menu, followed by clicking Add new cron job.