How scheduling and cron work

AI AutoPost checks campaigns every minute with WP-Cron. Learn how it works and how to set up a real server cron job.

Updated 1 view

How it works

  • AI AutoPost has one background task that runs every minute through WP-Cron.
  • Each time, it looks at all Live campaigns. A campaign that is due (by its own frequency, or the Auto Setup posting time) takes one new article and creates one post.
  • Only one run at a time. If a run with AI and image downloads is still busy, the next check waits. This stops the same article from being posted twice.
  • After a plugin update, the background task is created again automatically if it went missing.

Check the status

Go to AI AutoPost → Settings:

  • Cron Schedule → Status: ACTIVE (green) or NOT SCHEDULED.
  • Next Run: the time of the next check, for example in 40 secs, or overdue.
  • Frequency: Every minute.
  • Manual Run: Active Campaigns, Next Scheduled Run and Run All Campaigns Now.

The problem with WP-Cron

WordPress cron only runs when someone visits your site. On a new or quiet site, nobody may visit for an hour, so posts come late. "Overdue" next to Next Run is a sign of this.

Fix: a real server cron job

The Settings page shows these steps under WP-Cron not firing reliably?

Step 1: Add this line to your wp-config.php file, above the line /* That's all, stop editing! */:

define('DISABLE_WP_CRON', true);

Step 2: Add a server cron job (in cPanel Cron Jobs, Plesk, SSH or your hosting panel) that runs every minute:

* * * * * wget -q -O /dev/null https://yoursite.com/wp-cron.php?doing_wp_cron

Or with curl:

* * * * * curl -s https://yoursite.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1

Copy the exact line from your Settings page; it already contains your site address.

If your host does not allow a job every minute, every 5 minutes also works. Posts may then be up to 5 minutes late.

If the status says NOT SCHEDULED

  1. Reload the Settings page. The task is created again on the next page load.
  2. If it still says NOT SCHEDULED, deactivate and reactivate the plugin in Plugins. Your campaigns are kept.
  3. If it comes back, another plugin may be clearing scheduled events. A cron or "performance" plugin is often the cause.

See also Campaign not posting.

Feedback

Was this topic helpful?

Rate this topic

★★★★★

No ratings yet

Log in to rate this topic.

Questions & comments (0)

No comments yet. Have a question about this topic? Ask it here.