Support » Plugins » Trying to make certain posts expire in WordPress 2.0

  • After spending the greater part of the last 8 hours trying without success to make this work.
    I have searched, and on Google for a plugin or other solution.

    First I found: — to which the links do not work
    any longer, because apparently the plugin stopped working for unknown reasons around the first of
    the year

    — I finally came upon some code here:


    How to Set WordPress Posts to Automatically Expire After a Certain Number of Days

    in addition to this old discussion:

    I tried everything suggested, including rereading “Loop” articles in the Wiki.

    I added the following to the loop in the theme’s index.php file. My theme uses single.php not post.php, though
    I’m not sure that even applies:

    <?php list ($post_expired) = get_post_custom_values(‘postexpire’); /* only pay attention to the first one if there’s a duplicate */ ?>
    <?php if ( !$post_expired || current_time(‘mysql’) < $post_expired) : /* if there’s no expiration date or it’s not been reached yet, go ahead with displaying the post */ ?>

    After adding the above code and trying to view the site, the index.php (website’s homepage) is BLANK. Remove the code
    from the index.php file and the front page of the blog/website displays perfectly.

    I’m not sure if there is something that has changed in WordPress 2.0, but I really would like to get this working
    so that everyone has the option of expiring posts. According to what I’ve read this will still make the posts
    accessible from the admin section, but they will not be viewable on the site. This is perfect for my purposes,
    and I cannot believe this isn’t already a hot plugin.

    Any help on what I am doing wrong would be helpful. I did already add the key of postexpire and followed
    the instructions at for the value. I’ve really exhausted
    every avenue I can think of to try.

Viewing 3 replies - 1 through 3 (of 3 total)
  • From the time the wiki was used… a lot of things have been changed. The actual documentation is at the Codex. The old wiki is there only for the historians 🙂 = pre-1.5 versions.

    I think it’s not a hot plugin because bloggers love if people are reading their posts – even the old ones;)

    Have you tried Posts Expire?

    You can define an expiring date when you write a post and it seems to work (and without editing your loop…).

    Thank you so much! I looked all over for a plugin like this and it’s exactly what I was looking for. Not the first time Google was of no help in finding it.

    I guess I’m joining the bloggers who are monetizing their specialized knowledge. It’s easier to do that if everything you’ve ever written about how to do something is not available on your site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Trying to make certain posts expire in WordPress 2.0’ is closed to new replies.