Scheduled Posts

Auto-publish posts at a future date and time.

TL;DR

Edit a post → set Status to Scheduled → pick a future date and time in Published At. Requires php spark cron minute running via cron every minute, or Page Load mode. View the full schedule at Admin → Schedule.

Details

How Scheduling Works

When a post's status is set to scheduled, the PublishScheduledPosts Spark command (AppCommandsPublishScheduledPosts) handles publishing it at the right moment. The command runs every minute via the cron system (registered as the posts-publish task).

Each time it runs, it queries:

SELECT * FROM posts WHERE status = 'scheduled' AND published_at <= NOW()

For each matched post, it:

  1. Sets status to published.
  2. Records an activity log entry (post.published).
  3. Calls SocialSharingService::share() if share_on_publish is enabled on that post.

Setting a Scheduled Post

  1. Go to Admin → Posts → New Post (or edit an existing post).
  2. Set Status to Scheduled.
  3. Set Published At to any future date and time using the datetime picker.
  4. Save the post.

The post will remain invisible to the public until its published_at time is reached and the cron job has run.

Schedule Calendar

Admin → Schedule shows a full calendar view (FullCalendar) of all scheduled posts. Each scheduled post appears as a calendar event on its target publication date. Click an event to jump directly to the post editor. This gives a visual overview of your content pipeline.

Timing Accuracy

  • With cron: The cron minute command fires every minute, so scheduled posts go live within 60 seconds of their target time.
  • With Page Load mode: Posts are published when the next web request arrives after the target time. On low-traffic sites this could be minutes or hours late. For time-sensitive content, use a cron job.

Troubleshooting

  • Post not publishing? Verify the crontab is set up and running. Check that published_at is in the past. Confirm status is scheduled (not draft).
  • Timezone issues? Pubvana stores all timestamps in UTC. Set your server and database to UTC to avoid surprises with scheduled times.