Adds an expiry date to posts, pages, or custom post types in which the post becomes a draft.
Adds an expiry date and time to posts, pages, or custom post types in which the post becomes a draft.
How does it work?
The plugin uses WordPress’s built-in cron functionality. Every set time it will check whether there’s anything to expire. Previously it checked on pageload, which was resource-intensive on high-traffic websites. You can check when it’s going to run next on the top of this page.
When will it run first?
As soon as you hit the “Save Changes” button. If it’s at 2am, then 2am, and then x interval you set.
If you want to reset the time (say, you want to run it every day at 4am), you need to set the frequence to something else, and then back to daily at 4am. Future release of the plugin may have a “run first at” option, but not just yet.
How do I disable the default expiration time?
Click on the input field (color will change red if you move your mouse over it) and Save Changes
How often should I run the check?
That depends on the traffic your site is getting, and the granularity you want to achieve.
If you need to expire a piece of content at 15:34, then I suggest setting 15 minutes and clicking Save Changes at any of these times past the hour: 4, 19, 34, 49 minutes.
If you have a very high-traffic site with a lot of content, then I suggest running it daily at the wee hours of the morning (or when you have the least ammount of traffic. Check your analytics).
It will run a complete loop of every post type, so it might take a while, and eat up server memory and CPU cycles for a bit, which means for a short time your site will be slower.
It says the next scheduled check runs in a negative amount of minutes. What gives?
That’s just cron and WordPress being silly. Refresh should solve that problem, but basically, WordPress thinks the next schedule is still in the past. It will get there, don’t worry.
That’s all I can think of right now. If you have any other questions, post them here, or the plugins WordPress plugin page. Use latter for bugs, and this one for general questions / feature requests though.
Can I use this plugin on more than one post type?
Yes you can since version 1.2
Can I show the expiry date on the front end of my site?
Yes, since version 1.3.5, I have included the shorted code of [expirydate format=”d-m-Y”] or for those that would like to build it into their template, you can use es_ape_exp_date( $format )
. ($format is optional, and is the same as the PHP date formats (see http://uk.php.net/manual/en/function.date.php))