Skip to content

Set up a cron job

RowSprout generates pages in the background. When you save a template, its rows go into a queue, and every minute the queue builds the next batch of pages. That queue is run by Action Scheduler, which in turn relies on WordPress’s scheduler, WP-Cron.

WP-Cron is not a real timer: it only runs when someone loads a page of your site. That works on a busy site, but generation stalls when:

  • the site gets few visitors, for example a new site or a staging copy;
  • a page cache or CDN answers visitors without loading WordPress;
  • WP-Cron is switched off with DISABLE_WP_CRON, often by the host.

While you have the WordPress admin open, RowSprout keeps the queue moving on its own, so you may only notice the problem after you close the browser: the remaining pages stop appearing under RowSprout → Pages.

A cron job on the server fixes this by running WordPress’s scheduled tasks every minute, visitors or not. It also keeps the rest of WordPress’s scheduled tasks on time, such as scheduled posts, and RowSprout Pro’s licence check.

  1. Stop WP-Cron from running on page loads. Add this line to wp-config.php, above the line /* That's all, stop editing! */:

    define( 'DISABLE_WP_CRON', true );

    Visitors then no longer trigger the scheduled tasks; the cron job from the next step does. Skip this step if the line is already there.

  2. Add a cron job that runs every minute. Pick the method your hosting supports. Replace the path and the address with your own.

    The most reliable option, if WP-CLI is available on your server. It runs the tasks directly, without an HTTP request:

    Terminal window
    * * * * * wp --path=/var/www/example.com cron event run --due-now --quiet > /dev/null 2>&1

    --path is the folder that holds wp-config.php. Add the line with crontab -e, as the user that owns the WordPress files.

  3. Check that it works. Save a template with Create & update pages and close the browser. Within a few minutes, the new pages should be listed under RowSprout → Pages.

Go to Tools → Scheduled Actions and search for rowsprout:

  • Pending actions that are due in the future are normal: the recurring queue tick is always scheduled for the next minute.
  • Pending actions that are past due by more than a few minutes mean nothing is running the queue. Check the cron job, and that wp-cron.php is reachable.
  • Failed actions show the error that stopped a page from being generated.

With RowSprout Pro and WP-CLI, wp rowsprout queue-status shows how many rows are waiting, and wp rowsprout process-queue processes the queue right away. See the WP-CLI commands.