Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How to delete hidden posts from the database?

+3 votes
352 views
asked May 30, 2010 in Q2A Core by Scott
Can I just delete everything from qa_posts with "type LIKE '%HIDDEN%'" ???

Are there any repercussions? If I hid a question, are the answers/comments set to *_HIDDEN too? If they are not, then I guess deleting will leave orphaned answers/comments?
related to an answer for: Are points given/taken for hidden posts?

1 Answer

+2 votes
answered May 31, 2010 by gidgreen
selected Apr 22, 2013 by Scott
 
Best answer
Yes, deleting posts will lead to orphaned answers and comments. These shouldn't do any harm though, since they're already not in the index used for searches. Still I haven't tested this properly, so caution is recommended!

You could of course also create a query which deletes the orphaned answers and comments, by looking for posts with type=A or C and which can't be JOINed to another post via their parentid. Be sure to check the type because the parentid of posts with type=Q has a different meaning.
...