How to disable WordPress cron

WP-Cron executes specific tasks for WordPress sites.  The name Cron comes from the Unix/Linux service Cron, typically used to schedule commands or scripts.

Understanding WordPress Cron Job

WP-Cron, by default, only runs when someone visits your site. Whenever someone visits your site, WP-Cron checks if there are any scheduled tasks to be run. If it finds that a task’s scheduled time has been met, it will go ahead and run that task.

WP-Cron problems With Low Traffic Sites

Low traffic WordPress sites may experience skipped tasks when this feature is triggered by visitors. If people aren’t visiting your site, WP-Cron can’t execute. This doesn’t necessarily mean your page will be slow from previous jobs when someone eventually does visit your site. Tasks are run in the background, this is perfect, but depending on the task and its database aggressivity, the user browsing your site can have a bad experience.

How to Disable WP-Cron

If you’re a Wetopi client, we already have done this for you. At wetopi we run the wp-cron from an external cron service every 20 seconds.

Otherwise, first thing you have to do is to disable WP-Cron’s internal processing:

Add the following line to your wp-config.php file:

define('DISABLE_WP_CRON', true);

By disabling WP-Cron, you have turned off the automatic checking and calling of the wp-cron.php script. You will now have to call that URL using an external service.

Calling WP-Cron Externally

Once your internal WordPress cron is disabled you have to execute the wp-cron.php script by calling https://yourdomain.com/wp-cron.php

You can use your cpanel or plesk panel to add a cron job task.

If you don’t have a cron scheduler in your panel, You can set up an account in one of those free cron services:

Creating a single job that calls your site’s https://yourdomain.com/wp-cron.php script every 5 minutes is all you should need. WP-Cron will take care of the rest.

En resumidas cuentas, somos unos techies apasionados por WordPress que hemos creado Wetopi, un hosting especializado en WordPress, para minimizar la fricción a la que todo profesional se enfrenta al trabajar y alojar proyectos WordPress.

¿No tienes una cuenta en wetopi?

Prueba gratis – Descubrirás una manera eficiente de trabajar con WordPress

Incluye servidores desarrollo Gratis.
Sin tarjeta de crédito.

1 Star2 Stars3 Stars4 Stars5 Stars (11 votes, average: 4.55 out of 5)
How to disable WordPress cron
Share this post