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 want to display all posts as well as count the days of the post since it was published

if ($pageposts):
  foreach ($pageposts as $post):
    echo '<p>';


   echo '</p>';

Output should be something like this

Post Title1 - This post is published 4 days ago Post Title2 - This post is published 3 days ago Post Title3 - This post is published 6 days ago

and at the same time i want to delete the post once it reaches 10 days

I really need your help guys thanks i appreaciate it alot

share|improve this question

There's a small thread in WordPress support for this question, they recommend two plugins, Post Expirator and Auto Prune Posts.

share|improve this answer

check this tutorial - WordPress: make posts expire or auto-delete

share|improve this answer
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Wyck Aug 19 '12 at 0:52

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.