WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having some trouble with scheduling posts to automatically expire (either by deleting or going to draft), every plugin I have tried does nothing and when it reaches the scheduled time nothing happens, which is making me think its probably some simple thing I keep overlooking..

I thought I might be a problem with wp-cron, but I don’t seem to have any trouble setting up a publish date in the future through wordPress.

I have the latest version of Wordpress running, with multi-sites set-up. All plugins were at the latest version available at the moment.

Does anyone have any ideas?? I am running out of things to try...

Thanks in Advance


share|improve this question
NOTE: when using the plugin Content Scheduler, in the column for the expiry status the default is (Expiration Disabled) but when I enable it with a date nothing shows up, just a blank space, rather than the expiration date ... not sure if this might help – Tafts Mar 1 '11 at 5:54

create for these posts a customfield with the name expires and the value is the date for disabling the post. Use the following code in the Loop of your theme.

if (have_posts()) : while (have_posts()) : the_post();
  $exTime = get_post_custom_values('expires');
  if (is_array($exTime)) {      
  $exString= implode($exTime);
  $seconds = strtotime($exString) - time();
} else {
  $secondes = 1;
if ($seconds > 0) {
  echo "<h2>";
  echo "</h2>";

This code wont delete or drafting the posts. But you don't see it in the front. Perhaos this is a possible solution for your problem?

share|improve this answer
I had also tried hard coding it using a similar code and setting the date with custom values, still no luck – Tafts Mar 2 '11 at 0:53
up vote 1 down vote accepted

I got it working using the Post Expirator plugin, which also had the same problem, but by adding the following code to each loop right after 'the_post();' it checks the posts status on each page load, it is a temporary solution which seems to work for the moment.

// check to see whether post has expired
$expiration = get_post_meta($post->ID, "expiration-date", true);
if ($expiration && (time() > $expiration)) {
    $postSettings = array(
        'post_status' => 'draft'

} else {
// normal content goes here
share|improve this answer

I have tried VA Simple Expires


Works pretty well.

Unfortunately Post Expirator plugin did not work for me because posts imported via CSV did not expire.

Regarding VA Simple Expires - if you use CSV you should just add couple fields:

  • scadenza-enable=1
  • scadenza-date=target time (e.g. 2016-04-10 00:42:00)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.