MSC Post Expiry
Automatically expire posts and pages on a schedule — trash, delete, draft, make private, recategorise or redirect.
Install in
Set an expiration date on any post or page and MSC Post Expiry handles the rest — automatically.
When the date arrives, choose what happens: move to trash, permanently delete, revert to draft, make private, move to a different category, or keep the post live and redirect visitors. Perfect for limited-time offers, event announcements, job listings, seasonal content and legal notices that must come down on time.
Features:
- Schedule post expiration dates and times from the block editor sidebar or classic editor metabox
- Six expiration actions: move to trash, permanently delete, convert to draft, change to private, move to category, or redirect only
- Custom redirect URLs for expired posts
- Smart Expiry Rules: conditional actions by category, tag, author, post age, comment count, view count, or custom field — with priorities
- Bulk expiry scheduling from the Posts list
- Email notifications before posts expire (1–30 days ahead, to author, admin or both)
- SEO handling for expired posts (noindex/nofollow, canonical URL, 410 Gone status)
- Expiry analytics dashboard with charts (trends, action breakdown, top categories and authors) — Chart.js bundled locally, no CDN
- Action history log
- Works with any public post type, include or exclude mode
- Automatic processing via WordPress cron
- No external services, no tracking — GDPR-friendly
- Translated into 20 languages
- Developer-friendly with helper functions and hooks
Use Cases:
- Temporary promotional content that should disappear automatically
- Time-sensitive announcements
- Seasonal content management
- Event posts that should be archived
- Automatic content cleanup
- Redirect expired offers to current landing pages
- Notify authors before their content expires
The plugin adds a “Post Expiry” panel to the block editor sidebar and a metabox in the classic editor where you can set the expiration date and time. Once the scheduled time passes, the plugin automatically processes the post according to your configured settings.
Written by Joobi from the project's own listing. See the source page
1.7.4
- Fixed: Type-safety in settings output (
esc_attr()on integer values now string-cast). - Fixed: Cron
log_event()now accepts an optional context argument so the expiry timestamp is captured in the log; signature remains backward-compatible. - Fixed: Docblock type corrections on metabox callbacks to match the
add_meta_boxeshook contract. - Fixed: Timezone drift — expiry dates entered in the classic metabox or block-editor sidebar no longer drift by the site’s UTC offset on every save; dates are parsed in the site’s timezone and the sidebar uses core’s DateTimePicker with site-timezone conversion.
- Fixed: Processing stall — expiry processing no longer stalls when many already-processed expired posts pile up; the cron query now excludes already-processed posts. Any backlog of stuck posts will be processed on the first cron run after updating.
- Fixed: Republished posts — expired-state side effects (410/noindex/redirect) are cleared on republish and on expiry removal.
- Fixed: Sidebar expiry removal — the block-editor expiry sidebar can now clear/remove an expiry again (restores pre-1.7.4 capability via a Remove expiry button — the core DateTimePicker swap had removed it).
- Fixed: Stale processed flag — posts no longer keep expired-state side effects (410/noindex/redirect) after an expiry is cleared in the block editor; stale processed/notify flags now clear on any expiry removal, and the SEO/redirect gates additionally require a valid future/past timestamp.
- Fixed: External redirects — editor-set external redirect URLs are now honored for visitors (previously fell back to the admin login); empty/invalid URLs fall back to the site home page.
- Fixed: Reminder emails — now reach bulk-scheduled and rescheduled posts; the reminder flag resets when an expiry is moved to a new time (identical re-saves do nothing).
- Fixed: Debug log privacy — logging defaults to OFF for new installations (existing installations keep their current setting); the log directory is protected against direct access on Apache servers (
.htaccess+index.php); log writes are append-only with size-based rotation and retention cleanup. - Changed: Dev tooling security patch — composer dev-dependencies updated to clear CVE-2026-65954, CVE-2026-67434, and CVE-2026-45293;
composer auditis now clean. - Changed: Removed the unreachable legacy cron pipeline; post-meta authorization now checks per-post edit capability; the expiry action value is validated when written via REST; uninstall is now multisite-aware (cleans all sites); the custom cron schedule labels are now translatable (2 new strings).
- Added: Visible Remove expiry button in the classic metabox (previously required clearing both date+time fields manually).
- Added: Remove expiry bulk action; the bulk-set action now shows the configured window in its label, and both actions show a confirmation admin notice with the post count.
- Note: Targeted
phpcs:ignore(with rationale) on the dev-only translation script. - Note: Added regression tests for the timezone and processing-stall fixes (mock-based suite now 101 tests).
1.7.3
- Removed: deprecated admin CSS files (
admin-tokens.css,admin-components.css) that were shipping to WordPress.org but never loaded by any PHP code. - Improved: accessibility — added
scope="col"to all admin table headers,aria-labelon all Chart.js canvas elements,aria-describedbywiring on form controls paired with description paragraphs, and a<legend>on the Post types fieldset.
1.7.2
- Translation maintenance: added 8 new languages (Russian, Simplified Chinese, Turkish, Polish, Indonesian, Swedish, Ukrainian, Arabic) — now 20 locales bundled, all at 100% string coverage. No functional changes.
1.7.1
- Tested with WordPress 7.1. No functional changes.
1.7.0
- Changed: Support now links to the plugin’s WordPress.org support forum instead of the old contact button.
1.6.0
- New: Per-post override UI — set a different expiry action, redirect URL or target category for a single post, in both the block editor sidebar and the classic metabox.
- Fixed: Smart Rules created through the admin UI never fired — the form now saves rules in the format the rules engine reads, sets the enabled flag, and stores the priority.
- Fixed: Rule priority is now honoured — rules evaluate in priority order (lower number = higher priority).
- Added: Comment Count and Post Views conditions to the Smart Rules form (previously engine-only).
- Added: Rule name field, enabled checkbox, and a clearer rules table showing resolved conditions and status.
- Fixed: Consolidated the two expiry pipelines into one — expired posts are now processed every 5 minutes with the full feature set (Smart Rules, per-post overrides, SEO handling, notifications, analytics). Previously, posts scheduled via the classic editor could be expired by a legacy pipeline that skipped these features and could double-log actions.
- Fixed: Rescheduling an already-expired post from the block editor now re-arms processing.
- Changed: Legacy per-post date/time meta is migrated automatically to the unified timestamp format.
- Changed: Removed the unused rules database table (rules are stored in options; dropped on reactivation).
- Improved: WordPress.org listing rewritten — clearer title, searchable tags, expanded FAQ, and captioned screenshots.
1.5.2
- Confirmed compatibility with WordPress 7.0.2 — no functional changes.
- Updated “Tested up to” to 7.0.2.
1.5.1
- Refactored all analytics SQL queries to use fully-static SQL templates with toggle-pattern conditions, eliminating dynamic SQL construction that triggered WordPress.org review warnings
- Replaced
build_where_clause()SQL fragment assembly with flat associative array returning sanitized scalar values for direct$wpdb->prepare()parameterization - Removed all
phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPreparedandWordPress.DB.PreparedSQLPlaceholders.UnfinishedPreparecomments (no longer needed) - All database queries now use
$wpdb->prepare()with static SQL containing only%d/%splaceholders — no interpolated SQL fragments
1.5.0
- Fixed duplicate “Post Expiry” metabox appearing in block editor — classic metabox now only shows in classic editor via
use_block_editor_for_post()per-post check - Fixed data inconsistency: classic editor metabox now saves
_mscpe_expiry_timestampalongside date/time fields, ensuring cron processing works correctly - Fixed timezone display: metabox and template functions now use
wp_date()instead ofgmdate()for local time - Added autosave and revision guards to metabox save handler
- Added date/time format validation with regex before processing
- Added
strtotime()false guards inmscpe_is_post_expired()andmscpe_get_expiry_status()to prevent incorrect expiry detection - Replaced deprecated
current_time('timestamp')withtime()in expiry check functions - Added timestamp validation (
is_numeric()&&>0) to prevent 1970-01-01 display from non-numeric meta values
1.4.1
- Hardened input sanitization in settings flows and extension save hook payload.
- Moved settings inline JavaScript to an external admin asset loaded only on the plugin settings page.
- Moved analytics inline CSS to an external admin stylesheet loaded only on the Analytics tab.
- Bumped version to 1.4.1.
1.4.0
- Renamed class files for consistent MSCPE prefix (class-mscpe-plugin.php, class-mscpe-settings.php, class-mscpe-module.php)
- Bumped version to 1.4.0
1.3.0
- Complete translations for all 189 strings across 12 locales (de_DE, de_CH, es_ES, es_MX, fr_FR, fr_CA, it_IT, ja, nl_NL, nl_BE, pt_BR, pt_PT)
- Regenerated POT template with all current translatable strings
- Updated translation dictionaries from 59 to 188 entries per language
- Fixed Plugin Check SQL interpolation warnings in analytics
1.2.1
- Renamed “Conditional Expiry Rules” to “Smart Expiry Rules” with improved descriptions
- Updated Support tab with comprehensive feature documentation
- Added PHPUnit test suite
- Removed multi-step expiry workflows feature
- Fixed package.json and README.md version mismatches
1.2.0
- Added per-post expiry action override
- Added custom redirect URLs for expired posts
- Added “Redirect Only” expiry action
- Added conditional expiry rules engine (by category, tag, author, age, custom field)
- Added bulk expiry scheduling from Posts list
- Added email notifications before posts expire
- Added SEO handling (noindex, nofollow, canonical, HTTP status codes)
- Added analytics dashboard with Chart.js charts
- Added action history log
- Added block editor sidebar panel for setting expiry
- Added SEO, Rules, Analytics, and History tabs to settings
- Added redirect, notification, and logging settings
- Removed upgrade prompts (all features included)
1.1.0
- Rebranded to MSC Post Expiry
- Redesigned settings page with clean tab-based layout
- Added “Change to Private” expiry action
- Added “Move to Category” expiry action with category selector
- Fixed time-based expiry (posts now expire at exact scheduled times)
- Fixed log file append issue
- Fixed WP_Filesystem usage for WordPress.org Plugin Check compliance
- Added comprehensive debug logging for cron processing
1.0.0
- Initial release
- Post expiry scheduling with date and time
- Three expiration actions: trash, delete, draft
- Post type configuration (include/exclude modes)
- Automatic cron-based processing
- Comprehensive logging
- Developer helper functions
- Full internationalization support
Follow this listing's changes (Atom feed)