When using WordPress posts, there are many possibilities that you want to add post or page expiration date into your certain WordPress posts or pages. In this tutorial, you will learn how you can apply posts/pages expiration date in WordPress.
First download the Post Expirator plugin from WordPress plugins repository. This plugin is very handy to use. It allows to set expiration dates for posts and pages. You can also choose to have the post categories change at expiration time via plugin options page. It utilizes wp cron functions and triggers every minute by default, but you can change the schedule time according to your needs.
After activating the plugin and going to the plugin’s options page, you will find screen like below:
Date Format is the place where you will specify the date format.
Time Format option allows you to set time format.
Default Date/Time Duration: Set the default expiration date to be used when creating new posts and pages. Defaults to none.
Default Expiration Category: Set’s the default expiration category for the post.
Show in post footer? This will enable or disable displaying the post expiration date in the post footer.
Footer Contents: Enter the text you would like to appear at the bottom of every post that will expire. The following placeholders will be replaced with the post expiration date in the following format:
EXPIRATIONFULL -> Thursday June 27th, 2013 6:50pm
EXPIRATIONDATE -> Thursday June 27th, 2013
EXPIRATIONTIME -> 6:50pm
After the configuration on the plugin’s options panel. Go to the post or page where you want to set expiry date. On the post or page, you will find the section like below:
After click on “Enable Post Expiration“, you can edit the expiration details. “How to expire” drop down allows you to specify, after post or page expiration what will be the status of the post. The drop down has options: Draft, Delete, Private, Category: Replace, Category: Add and Category Remove.
After the entire setup, update the post or page. In the post or page detail page, you will find the text like below:
If you any question, comment below.