Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 tasks, etc. The problem is that it is run when someone visits the website, which often causes extra resources resource usage. This is especially important for popular websites, where this process can slow down the website. SolutionA solution, as recommended by the WordPress developers, is to disable WP_CRON and create a cPanel cronjob making a web request to the file in the time, schedule 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 the appropriate option in your CpanelcPanel:
    0 0 * * * php /home/$USER/public_html/wp-cron.php >/dev/null 2>&1
    This will run wp-cron.php at midnight.

Info

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

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

...