How to Replace the WordPress Cron with a Real Cron Job Print

  • Wordpress Cron Job, Disable Wordpress Cron Job
  • 786

Learning.png

WordPress is a CMS powerhouse that works on almost every operating system, device, and platform that are out there.

It's why it has its own cronjob service to manage scheduled tasks in an automated way.

The wp-cron.php file, in your main WordPress directory, runs the WordPress cronjob service every time somebody loads your website in a browser. It verifies if there’s a scheduled task to be done and then executes it if required.

In some cases, this cronjob file may become a target of a DOS attack, or your caching plugins can interfere with its execution overloading your cloud server or interfering with the scheduled tasks in a way that they don't execute properly and timely.

As a result, your WordPress website can have performance issues or at times it may not function at all.

A solution is to disable the Wordpress Cronjob file execution and replace it with a real Cronjob on the cloud server itself.

To disable the WordPress Cronjob, open your wp-config.php file in your main WordPress directory, add the following line before /* That’s all, stop editing! Happy blogging. */ line and hit save:

define('DISABLE_WP_CRON', true);

And Viola, you have disabled a major resource hog on your Wordpress! 

You need to check with your WordPress Theme and Plugins developers and see if you need a Cronjob for your website to function as normal. If you do, you can set up a real cron job on your Google Cloud and execute the wp-cron.php file with it less frequently.

For example, a Cronjob running every 30 minutes should be fine for most websites.

To add your Cronjob, simply go to your Sites.Tools URL, login, and go to the Cron Jobs option.

 


Was this answer helpful?

« Back

Powered by WHMCompleteSolution