You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

What is the purpose of the wp-cron.php file? It is responsible for different scheduled tasks, like checking updates, sending notifications, posting scheduled task etc. The problem is that it is run when someone visits the website, often causes extra resources usage. This is especially important for popular websites, where this process can slow down the website. Solution, recommended by the WordPress developers is to disable WP_CRON and create a cronjob making web request to the file in the time, suitable for you.

Please, do the following:

 

  1. Open the wp-config.php file for editing and add the following line:
    define('DISABLE_WP_CRON', true);
  2. Add the following cronjob using appropriate option in your Cpanel
    0 0 * * * php /home/$USER/public_html/wp-cron.php >/dev/null 2>&1
    This will run wp-cron.php at midnight.

Please, note that $USER in this example should be replaced by the actual user name of your account (your Cpanel login). Also, the actual path to wp-cron.php can be different, since your WordPress website may be installed into subfolder. If you face any difficulties, please, contact support.

Information about Cpanel Cron Jobs can be fund at https://documentation.cpanel.net/display/ALD/Cron+Jobs

 

  • No labels