vmware-marketplacewordpress

Disable the WordPress cron script

The wp-cron.php script will run once a user visits your site. If you get a lot of traffic, this could be a problem. This cron task is really necessary when you make updates in the blog. You can move this cron script to a system cron task to help lower resource usage on the server.

Disable the wp-cron.php script in the /opt/bitnami/wordpress/wp-config.php file. The location is important - add the line below just before the database settings:

define('DISABLE_WP_CRON', true);

Then, add the cron task to the system. For example, this cron task will run the wp-cron.php process every hour. You can add it using the following command:

$ sudo crontab -e
0 * * * * su daemon -s /bin/sh -c "cd /opt/bitnami/wordpress; /opt/bitnami/php/bin/php -q wp-cron.php"
Last modification February 9, 2023