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


  • 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, 2011 at 5:54

3 Answers 3


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?

  • I had also tried hard coding it using a similar code and setting the date with custom values, still no luck
    – Tafts
    Mar 2, 2011 at 0:53

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

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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