How to disable wp-cron.php

The purpose of the wp-cron.php script is to run scheduled items (such as future posts) and is geared toward users who do not have access to cron jobs. As this file is accessed even via regular requests to a site, it can (and will) consume server resources and can create issues with loads if a site is particularly busy. Real cron access is available to all clients in their hosting packages, so the internal Wordpress cron is not required and ideally should be disabled.

To disable the wp-cron.php script, open the wp-config.php file from your wordpress installation and add this line at the top of the file, just under the first line, which contains the opening PHP tag:

define('DISABLE_WP_CRON', 'true');

This will disable the wordpress internal cron. A standalone cron can then be created, if required, from the control panel, under the Advanced option block. Choose Cron Jobs and then complete the timeframe for the job to run. Generally, running the job every two or three hours is sufficient. To run the scheduler every three hours, at the top of the hour, put the following values into the cron time fields:

0 */3 * * *

In the Command line, the cron must be provided with the path to the script, and preceded with the php command. If your Wordpress installation is at the root of the site, directly under the public_html directory, the command would be:

php -q /home/yourusername/public_html/wp-cron.php

If the Wordpress installation is in a subdirectory (for instance, /blog), the command would be:

php -q /home/yourusername/public_html/blog/wp-cron.php

Once the times and the command have been entered, save the form, and the job will be activated.

For any questions or assistance in setting up crons, or disabling the internal Wordpress cron script, please contact support.
  • 1 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

PHP script error: FATAL ERROR: register_globals is disabled in php.ini, please enable it!

<b>Symptom: </b>The following error appears on a site running a php-based...

HOW TO: Combat referer spam/block certain referers

Symptom: A client wishes to deny access to their site (or parts of it) when the traffic is...

Expression Engine installation generates "variable references" error

Symptom: Expression Engine installations older than version 1.3.1 generate an "Only variable...

My phpBB forum installation is not accessible

Symptom: Client cannot access phpBB forum installation. Permissions on the forum installation...

Enabling register_globals

Symptom: A client's script requires that register_globals be enabled.Resolution: Globals are not...