2.13.1.1.9. Increased load from wp-cron.php

wp-cron.php — built—in WordPress task scheduler. It can be used to publish deferred posts, check for updates of installed themes and plugins, send notifications, and perform other time—dependent operations. Some of these tasks can be quite resource intensive and can be a source of increased load, in case of too frequent start-up (the frequency of start-ups can be found, for example, from access logs site by filtering records by wp-cron.php). Configuring the launch of the built-in scheduler via croninstead of launching by means of the site itself.

To reconfigure the launch of the WordPress scheduler:

  1. Openup config file site wp-config.php in the built-in editor filemanager or any FTPclient.
  2. Add at the beginning of the file (right after <?php) a line like this:
    define('DISABLE_WP_CRON', true);
  3. Save your changes.
  4. Add a cron task with such content (substituting instead example.com your site address):
    /usr/bin/wget -t 1 -O - 'http://exemple.com/wp-cron.php?doing_wp_cron' >/dev/null 2>&1

    It is recommended to set the startup interval within the range from 15 minutes to 1 hour.

  5. Check the work of the scheduler by scheduling the publication of a record, for example, in 1-2 hours from the current time. If the post is published, then everything is configured correctly.
Content