Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
932 views
in Q2A Core by
Hi, I deleted all questions but widget counter says there is still some answers there. How to delete all that? I want to start fresh, but to keep other database data (like settings, users, etc)
Q2A version: 1.8.1

2 Answers

0 votes
by
edited by
 
Best answer

you can do it by two ways: 

in your mysql you can TRUNCATE TABLE qa_posts; 

OR

you also can DELETE * TABLE qa_posts WHERE postid > 0;

 The difference between them is (1) Truncate is more quick than Delete; and (2) Truncate will reset the primary autoincrement key (postid) to 1, but delete will preserve the postid key.

But you also need to clear out all other postid related tables expect below. For example: 

qa_users
qa_usermetas
qa_usermeta
qa_userlevels
qa_userlogins
qa_userfields
qa_pages
qa_messages
qa_iplimits
qa_categories
qa_blobs
qa_widgets

Alternatively, you can user export above tables to your pc, then delete whole database, then re-install and import above tables. 

+1 vote
by

If you have already deleted all posts then you just need to go to admin/stats and click all the buttons in the Database clean-up operations section. Then the widget counter, along with a lot of other information, will be cleaned/recalculated.

BTW, I wonder why you need to delete posts and keep users... that's just not good :/

...