WordPress.org

Ready to get started?Download WordPress

Forums

Post expires after set date or number of days. (18 posts)

  1. kcomphlint
    Member
    Posted 9 years ago #

    Is there a plugin/hack for WP1.2 that would allow you to set a date that a Post should expire, and have it removed from the list of posts, maybe have it marked as private or something like that?

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    I cannot recall such a plugin.
    Would I be right in thinking you mean selected posts, not all posts ?

  3. kcomphlint
    Member
    Posted 9 years ago #

    Right. Selected posts. For instance, If you are using WP to post information about events that occur on certain dates, and you don't want to have to login all the time and remove events that have occured and such.

  4. davidchait
    Member
    Posted 9 years ago #

    Just thinking out loud:
    'automated'
    want a meta-flag that is the expiry date. checks maybe once per day for posts matching or exceeding their expiry date that aren't marked private, and marks them such.
    'constant'
    same meta-flag, however have the post loop include a join testing the meta flag as part of its query for active articles.
    -d

  5. planetthoughtful
    Member
    Posted 9 years ago #

    I may be missing something, as I'm very new to WordPress, but if WordPress is delivered via PHP / MySQL then wouldn't activating post expiry be as simply as changing the SQL statements that draw the posts to something like this pseudo statement:
    SELECT * from tblposts where displaydate > Now() and expiredate < Now()
    I'm not suggesting the actual statement(s) would be that simple, but the point is, WordPress seems to dynamically draw its posts from the underlying database when each page is requested. You shouldn't need Cron jobs etc to exclude expired posts, it should be possible to exclude them using the SQL that pulls the posts for display.
    Again, could be wildly wrong.
    Regards,
    Murray

  6. DennisWilliamson
    Member
    Posted 9 years ago #

    In davidchait's post, the 'constant' option would use SQL to exclude expired posts. The only way I can see for his 'automated' option to work would be with something like cron.
    My 'purge' idea would allow the admin to clear out expired posts in order to reduce space taken up in the table.

  7. planetthoughtful
    Member
    Posted 9 years ago #

    I confess, I don't quite understand what is meant by the 'automated' option.
    Would people want to purge old articles, even if they're not visible anymore? Chances are, the moment they're purged, someone is going to want the details again.
    At worst, you could offer an admin purge process, which is probably more in keeping with maintaining the application contained within a PHP / MySQL solution base, rather than having to rely on timed cron jobs, which may or may not be available to some people wishing to use WordPress.
    However, speaking as someone who would like to have the 'expire' functionality, I wouldn't want posts automatically purged, unless there was another flag at post creation / edit time to control this behaviour.
    As another alternative, an admin page that displays all expired articles and allows you to select those you wish to be purged?

  8. divrom
    Member
    Posted 9 years ago #

    Has anyone managed to develop such a plug-in yet. It's one of the more helpful features of, e.g., Drupal and Mambo.

    It would be great if we could set a post to go live at a specific date and vanish into the archives at a set date. (I'm thinking mostly of those who use their WP sites like a mini-CMS.)

  9. Sokrates
    Member
    Posted 9 years ago #

    This link to the old Wiki explains how to do it with a few lines of code and a custom field:

    http://wiki.wordpress.org/?pagename=ExpirePosts

    Works in 1.5 too :) Is this what you wanted?

  10. divrom
    Member
    Posted 9 years ago #

    Sokrates,

    You better back away, 'cos I am filled with love for you right now and I might end up hugging ya! :-)

    That's exactly what I wanted to do!

    Thanks.

  11. Sokrates
    Member
    Posted 9 years ago #

    u r welcome. nice site by the way!

  12. divrom
    Member
    Posted 9 years ago #

    Thanks! :-)

    How do u do the rotating image, btw?

  13. Sokrates
    Member
    Posted 9 years ago #

    Dan Benjamin wrote the script

    His website : http://hivelogic.com/showroom.php

    & A List Apart (excellent site):

    http://www.alistapart.com/articles/betterrotator/

    I'm half tempted to switch the header to a .swf client side job, rotator.php does seem to be a little processor/server intensive - a bit if a problem if you're on a budget server :)

  14. divrom
    Member
    Posted 9 years ago #

    Ah, thanks.

    I know ALA. They are responsible for getting me to my current level of incompetence. But I must have missed that.

    Thanks again.

  15. richschmidt
    Member
    Posted 8 years ago #

    And now that wiki page is lost... evidently. Anybody know what that code was?

    I use the EventCalendar 3 plugin for coming events... They vanish out of the list once they are past. But I'd love to know how to make other, non-calendar posts expire...

  16. geetarista
    Member
    Posted 8 years ago #

    Rich,

    I was able to find it by searching Google's cache. It didn't show it at first, so I just did a text only cache. Check it out:

    http://64.233.167.104/search?q=cache:9TRBl6QO8lUJ:wiki.wordpress.org/?pagename=ExpirePosts+&hl=en&lr=&strip=1

  17. richschmidt
    Member
    Posted 8 years ago #

    Cool, thanks. :) Seems simple enough... I'll have to try it. :)

  18. justy
    Member
    Posted 8 years ago #

    I have a simple request- I've hacked WP so that it's more like an online diary than a blog. As such I need to prevent posts from expiring- ever.

    Surely there's a quick hack to achive this?

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic