Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/mabfahad/wp-post-expiry/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
WP Post Expiry is a lightweight WordPress plugin that allows you to set expiry dates for posts. Once the specified time is reached, the post will be automatically unpublished (set to draft).
✨ Features
- Set an expiry date for any post
- Automatic unpublishing of expired posts
- Hourly checks using WordPress cron
- Simple user interface in the post editor
- No impact on performance
- Clean and modular code
📦 Installation
- Download the plugin ZIP or clone the repository.
- Upload the folder to your
/wp-content/plugins/directory. - Activate the plugin through the WordPress admin panel.
- While editing a post, set the expiry date in the meta box provided.
🛠 Usage
- Navigate to any post.
- Set the expiry date using the calendar field in the meta box.
- The plugin will automatically unpublish the post at the set date and time.
🔄 How It Works
The plugin schedules a cron event that runs every hour. It checks for posts with expiry dates that have passed and sets their status to draft.
🧩 Developers
- Object-oriented structure
- Easy to extend and hook into
- Organized in
/includes/classes/with autoload-ready patterns
📄 License
Licensed under the GPLv2 or later.
👤 Author
Md Abdullah Al Fahad
GitHub: @mabfahad
🙏 Contributions
Pull requests and issues are welcome!