Skip to content

Cron

Loveshack schedules subscriber digest processing through WP-Cron using the hook:

lss_process_subscriber_digests

The processor runs every ten minutes.

Why you need real cron

WP-Cron is not a scheduler — it is a queue that gets drained when someone visits the site. On a low-traffic site that means digests go out late or not at all, and on a high-traffic site it means the work happens inside a visitor's page load.

For production, disable visitor-triggered WP-Cron and drive it from a real cron job.

Setup

Add this to wp-config.php:

define( 'DISABLE_WP_CRON', true );

Then add a cron entry. The WP-CLI form is recommended:

*/10 * * * * cd /path/to/site && wp cron event run --due-now >/dev/null 2>&1

Or, if WP-CLI is not available, use the HTTP form:

*/10 * * * * curl -fsS https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Do not skip the constant

Adding a cron job without setting DISABLE_WP_CRON leaves both paths active. They will not duplicate emails, but you lose the predictable timing that was the point of adding cron.

Bedrock

On Bedrock installs, run the WP-CLI command from the project root, not from web/, so wp can load the site configuration:

*/10 * * * * cd /srv/example.com && wp cron event run --due-now >/dev/null 2>&1

Verifying

Check that the event is scheduled:

wp cron event list --fields=hook,next_run_relative | grep lss_

Run it once by hand:

wp cron event run lss_process_subscriber_digests

If the hook is missing entirely, the theme was probably activated before the scheduling module loaded — deactivate and reactivate the theme to reschedule it.