Skip to content

Auto-Expiration — Pins That Unpin Themselves

Configure the plugin to auto-unpin sticky posts after a fixed number of days. Keeps the activity stream fresh without anyone having to remember to clean it up.

Auto-expiration setting in the Lifecycle tab

  1. Each pin row in {prefix}bpsp_sticky_posts gets an expires_at timestamp when Sticky Post Expiration is greater than zero.
  2. An hourly WP-Cron event walks the table and unpins anything whose expires_at has passed.
  3. Each expiry is recorded in the Activity Log as Auto-expired (alongside pin / unpin entries).
  4. The bpsp_sticky_post_expired action fires per expired pin so other plugins can react.

Lifecycle → Auto-Expiration → Expire after

Setting Default Range
Expire after (days) 0 0–365

0 = pins never expire automatically. Anything from 1 upward enables the cron sweep.

Common choices:

  • 7 days — weekly events, time-sensitive announcements.
  • 30 days — month-long campaigns, evergreen rules with regular review.
  • 90 days — slow-moving content like onboarding tips.

Auto-expiration is an additional cleanup mechanism. Members and admins can still unpin manually before the timer runs out — the row is removed and the cron sweep ignores it next hour.

When logging is enabled, expiries appear with an Auto-expired badge in the Activity Log table:

When Action User Activity Component
2026-04-21 09:00:01 Auto-expired System #1234 Activity

The user_id column is 0 for cron-driven expiries — there’s no human actor.

The expiry sweep runs on the WordPress bpsp_check_expired_sticky_posts cron event, hourly. If your site disables WP-Cron in wp-config.php, set up a real system cron to hit wp-cron.php so the sweep runs. To check that the event is scheduled:

Terminal window
wp cron event list --hook=bpsp_check_expired_sticky_posts