Black Friday: Up to 40% off all plans!

Offer automatically applied at checkout
Days
Hours
Minutes
Seconds

FAQs

Find answers to common questions and step-by-step solutions.

Glossary

An alphabetical list of terms and their definitions.​

Video Library

Discover our tutorials

Understanding WordPress Cron

Note: These documents refer to features and updates in the upcoming v5 release, which will be available soon. Some information may not apply to earlier versions. Stay tuned for the official launch announcement!

IN THIS ARTICLE
This guide explains the workings and limitations of WordPress cron, and instructs you on configuring the Update Strategy feature to fetch new content at custom intervals.
Contents

In WordPress, the concept of cron is essential for running scheduled tasks automatically. For users of Aggregator, cron plays a significant role in ensuring that sources (feeds) are updated regularly. This article will explain how WordPress cron works, its limitations, and how to configure it to work best for your Aggregator setup.

Configuring the Update Strategy Cron in Aggregator

With Aggregator, you can configure how frequently the plugin checks and fetches new content for each source using the Update Strategy feature. You have the flexibility to set custom intervals such as every 15 minutes, hourly, or any other custom frequency that suits your needs, in minutes, hours, days, weeks, or months. These are the cron intervals.

While this is a powerful feature, it’s important to understand how WordPress cron works, as it determines when these updates happen and what might cause them to get stuck.

What is Cron?

Cron is a task scheduler that allows you to schedule actions like running scripts or executing commands at specific times without your manual intervention. For example, you could schedule a task to run every day at midnight to back up your website data – that’s a cron job.

This automation reduces manual tasks and ensures that important actions, such as content updates or database cleanups, happen at the right time and on a regular basis.

What is WordPress Cron?

WordPress has its own version of cron, often referred to as WP-Cron. Unlike traditional cron systems, which run based on server time, WordPress Cron works differently due to the variety of hosting environments WordPress can be installed on. WP-Cron runs based on visits to your site. Here’s how it works:

  1. A visitor arrives on any page of your WordPress site.
  2. WordPress checks to see if any scheduled tasks (cron jobs) need to be run.
  3. If a task is due, WP-Cron triggers it to run.

How Does WP-Cron Affect Aggregator?

When you set a source to update every 15 minutes, WP-Cron is responsible for ensuring that this update happens. However, WP-Cron’s reliance on site visitors means that if your website has low (or no) traffic, tasks like fetching new items from a source might not run as scheduled. In other words, if no one visits your website for hours, WP-Cron will not trigger, and the feed updates will not occur during that time.

Common Issues with WP-Cron

1. Stuck Cron Jobs

One of the most common problems users face with Aggregator is that the cron jobs responsible for fetching new items get “stuck.” This happens when WP-Cron isn’t running as expected, and scheduled updates fail to occur.

2. Cron Job Delays

As WP-Cron relies on visitors, websites with low traffic may experience delays in cron job execution. If your site is new or has irregular traffic, your sources may not update as frequently as you’d like.

How to Check if WP-Cron is Working Properly

If you suspect that WP-Cron is not functioning correctly, you can use a free plugin called WP Crontrol. This tool allows you to view, manage, and troubleshoot WordPress cron events. Here’s how to use it:

  1. Install the WP Crontrol plugin from the WordPress.org repository.
  2. Go to Tools > Cron Events in your WordPress dashboard.
  3. Review the list of scheduled cron jobs.

If you see a list of events scheduled in the past with a status of “Now,” it indicates that your cron jobs are stuck.

Troubleshooting Stuck Cron Jobs

The most effective way to resolve stuck cron jobs is to contact your hosting provider. Explain the issue and provide them with details about how WP-Cron operates. Your host should be able to help resolve the problem, often by adjusting server resources or configuring a server-level cron job (which is the most reliable).

Improving WP-Cron for Reliable Updates

If you want more precise control over WP-Cron or need to ensure that scheduled tasks run on time, regardless of site traffic, you can set up a server cron job to call the wp-cron.php file directly. This will ensure that cron jobs are triggered at the intervals you set, without relying on site visitors.

Speak with your hosting provider to set up a server cron job for your website. Most reliable hosts these days will offer you this option and implement it for you themselves.

Alternative: Use an Online Cron Service

If your hosting provider doesn’t offer cron job support or you prefer a simpler setup, you can use an online cron service. These services will trigger the WP-Cron process by sending a request to wp-cron.php at specified intervals.

One popular service for this purpose is EasyCron, which provides a guide specifically for Aggregator users, detailing how to set up a reliable cron schedule.

GIVE FEEDBACK

Was this article helpful?

Still stuck?

Find Your Perfect Plan

Answer a few questions, and we’ll recommend the best option for you!