1. Home
  2. WP Toolkit
  3. Setting up a Regular Run of wp-cron.php

Setting up a Regular Run of wp-cron.php

Setting up a Regular Run of wp-cron.php

The wp-cron.php file is a virtual cron job (or scheduled task) WordPress uses to automate certain operations, for example, checking for plugins or themes updates, sending email notifications, and so on. By default, WordPress runs the wp-cron.php task every time someone visits your website. If you want WordPress operations to be performed regularly and on schedule, you need to disable the default wp-cron.php execution.

If your website has high traffic, scheduled wp-cron.php execution may also improve the website load time.

To disable wp-cron.php on a particular WordPress installation:

  1. Go to WordPress and choose the WordPress installation for which you want to disable the default wp-cron.php execution.

  2. Turn on “Take over wp-cron.php” on the installation card.

    The default wp-cron.php execution is now disabled.

  3. By default, WP Toolkit automatically creates a replacement scheduled task. It will now run wp-cron.php every 30 minutes.

    In the following cases, you may not need a replacement task:

    • You already have or planning to have your own replacement task.
    • You do not need any replacement task because running wp-cron.php has a negative impact on your website.

    To choose not to create a replacement task or delete the one already created by WP Toolkit, click the  and then turn off “Create a replacement task when takeover is initiated”.

  4. (Optional) You may want to run wp-cron.php on a different schedule. To do so, click the  icon and, next to “Create a replacement task…”, click the  icon. This will open a new Plesk tab with scheduled tasks. Change the default 30-minute interval, and then save changes.

     

     

    Note: The  icon next to “Create a replacement task…” is displayed if you have the permission to manage scheduled tasks.

    Note: If you removed a replacement task by mistake, you can always recreate it. To do so, click the  icon, turn off, and then turn back on “Create a replacement task when takeover is initiated”.

The Plesk administrator can disable wp-cron.php on all new WordPress installations.

Prior wp-cron.php Configurations

You may have already disabled wp-cron.php without WP Toolkit by using the following ways:

  • Editing the wp-config.php file. In this case, WP Toolkit will detect this change and adjust the “Take over wp-cron.php” toggle.
  • Creating your own replacement scheduled task. In this case, WP Toolkit can create another one once you turn on “Take over wp-cron.php” in the WP Toolkit interface. You can choose between the following options:
    • Keep two tasks (it will not much affect the performance).
    • Delete your task and keep the task created by WP Toolkit.
    • Keep your task and delete the task created by WP Toolkit. To do so, turn off “Create a replacement task when takeover is initiated”.

How can we help?