Bulk undelete topics

AI-generated summary

The discussion revolves around bulk undeleting topics in Discourse. rahulMasal is seeking help to undelete multiple deleted posts simultaneously. According to cocococosti, there is no built-in “undelete” bulk action, but this can be achieved using the Discourse API.

cocococosti explains that the API can be reverse-engineered to perform bulk undeletion by making successive PUT calls to /posts/<post-id>/recover with a list of post IDs. A screenshot is provided to illustrate this process. Additionally, pfaffman offers hints on how to accomplish this using Rails, with a link to a relevant topic: Bulk un-deletion.

I need help to undelete deleted posts but in bulk!

eg.
https://example.com/u/{user}/deleted-posts

so i can access all posts but we need to undelete it in bulk!

There is no “undelete” bulk action that I know of, so you’ll need to write a script for this and use the Discourse API. Everything you do in Discourse you can do through the API, check this topic to learn how Reverse engineer the Discourse API

As instructed in the topic, if you check your network tab (in your browser’s dev tools), you’ll see that whenever the “reverse delete” button is clicked, there is a PUT call made to /posts/<post-id>/recover

So, if you have a list of IDs of the posts you want to “undelete” then you could do so by making successive calls to that end point.

Did you get this with the API?

If not, here are hints of how to do it in rails: Bulk un-deletion - #3 by pfaffman