I need to create a feed (RSS or Atom) of posts and comments that have been deleted (ie moved to Trash).

What's the best way of doing this? Right now I'm thinking about creating 2 pages templates containing a SQL / $wpdb query that returns posts and comments with trashed status (and then creating new pages eg deletedposts / deletedcomments)

Any better ways? Main reason for doing it this way is easy routing - ie the URLs are created for me. How would I handle the routing if I put this in a plugin and don't create pages?

2 Answers 2


Well if you want a feed it would be logical to create a feed, rather than emulate it with page.

add_feed() ( source ) and your queries+output in callback.

  • Ah - ok, that's exactly what I was looking for - cheers.
    – anu
    Commented Apr 18, 2011 at 13:41

Maybe the easiest thing to do is create a category called Trash and move your posts there; then you've got an automatic post and comment feed without a plugin or custom queries and with a slug of Trash.

  • But then I'd need to filter out that category in every loop / query in the rest of the site
    – anu
    Commented Apr 18, 2011 at 13:36

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.