The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Since this question is about:
1. Saving posts with a timestamp
2. Checking the timestamp against the current time (to work out age)
3. Issuing commands to the database or filesystem to delete posts
...it's most appropriate for the Basic PHP forum.

auricle's got the basics for ya. In your database table containing the posts, you should store the date and time of the post (a datetime field or timestamp). Then a single database query can tell you what posts are 3 months old, so that you can delete or archive them.

It's basically what's sometimes called Garbage Collection. I use that same process on a website I created to make sure inactive users are logged off. It's a very fast script that runs on every PHP page that uses a database connection (which is most of them).

There's no point in trying to give you code - the process is already outlined above.