The discussion is about deleting all messages from a user in a specific category. Iceman initially tried using the search function and bulk deletion, but it only deleted topics, not messages. JammyDodger suggested using the API or searching for ‘rails delete post’ for a solution. Iceman clarified that he wants to delete all messages from a user in a specific category.
Akshine provided a solution using the Rails console, which involves running a script with the category slug and username. The script deletes posts from the specified user in the specified category, excluding the first post to avoid deleting the topic. Wingtip had a similar issue and found Akshine’s solution helpful. It is recommended to make a backup before making any changes.
Recently I had the need to delete all posts from a user in a specific category. Leaving aside “debates” on deleting content I thought “oh, easy, just use the search and then pick all the results using the checkboxes and delete them”.
However, it seems that doing so allows me to delete The Topics and not so much the messages, even though the search is giving me the messages as results, not necessarily the topics (although they are there as well, yes).
Is there a “safe” way of doing this? At first I thought that I would be something very extreme to the DB (and I don’t discard that possibility) but since I can bulk-delete 50+ topics from the UI… maybe there is a way of doing that for messages only? (Or a way using the console, I just don’t want to “try” and blow up the DB )
Apologies for the necro, happy to create a new post if required.
We have a politics category and some users would like to delete all their posts from this category for obvious reasons. Is there any way to easily do this for them?