Over the last few weeks I have been working with Brian Richards to produce a plugin development course for his WPSessions VIP program. Throughout the course, we wrote a plugin from start to finish, and Simple Post Expiration this is that plugin. It’s a simple little plugin that allows you to set an expiration date on posts. Once a post is expired, the title of the post is automatically prefixed with the word “Expired”, or any word you have chosen.
Once activated, the plugin will add a date field to the Publish metabox in the post editor screen. This date field lets you specify an expiration date. Once the expiration date is reached, the post title gets automatically prefixed with “Expired”. If your post was titled “Great Deals for the Summer”, it would show up as “Expired: Great Deals for the Summer” once expired.
Along with automatically prefixing titles of expired posts, the plugin includes two additional options: a short code and a widget.
The [expired] short code lets you display the expiration date of the post within the post content. It also accepts several parameters to modify the exact text that is displayed (see the plugin page on WordPress.org for details).
The Expired / Expiring Posts widget lets you display a list of posts that are either expired or expiring soon, similar to the Recent Posts widget,
You can read more about the course and see an introduction video in the post I wrote a few weeks agocourse overview page on WPSessions.