Deleting Questions does not delete user rating or questions answered!


Using QA Plugin and doing a lot of test questions before launch.

Deleted all test questions but

1) Popular Users are still showing up in popular user widget, they have popular rating even though no questions exist anymore.

2) When you view a users profile the tabs under their profile photo says how many questions they answered (But none exist as they were deleted) So it is confusing as it lists 10 questions for example but none of them exist.

3) In this same tab (10 Answers for example) it even displays the titles to questions that were deleted and don't exist. Clicking them gives a 404.

So there is obviously some clean up issues going on when a question is deleted it is not deleting the relationships associated with it. I can also see the scenario if a moderated question was deleted by me and it ended up being popular it would also not disappear and remain on the site which is not a good scenario as people end up getting a lot of 404's.

2 Questions:

a) How can I clean up the database for a short term fix to properly get rid of old content or relationships to old questions as described above?

b) Can you please update the plugin to correctly handle when questions are deleted from the site?


  • Hakan


    If you are using a website for test purposes, and you intend to delete your test questions, you should also use test users and delete your test users after everything is ok. Then all related data combined to the user will also be deleted.

    Q&A cannot know if they were indeed test questions/users or not. If they were answered correctly and accepted, the points user had taken will stay unless you delete the user.

    I didn't understand why you receive a 404 response. Can you give me a link?


  • stephen_martin

    Hi Hakan,

    SUre I get the whole 'test' scenario and then should delete those users, but it also applies to a real case sceanrios when the site is live.

    For example:

    Lets say I (as admin) delete questions from a user which the site deemed inappropriate. I am not deleting the user but just the question we felt was not suited.

    Also if a user decides to delete a question they asked

    So in both these sceanrios the points for those questions would not be removed.

    Also when you go to the users profile (basically click on their name from the Q&A Page) you can still see the deleted question in their tab "Answers" if they answered it, so basically that is not being deleted from their profile information. The 404 comes when you click on the "deleted" question in this tab as the backend has deleted it but the frontend has not.

    Hope that makes more sense if not please let me know


  • Hakan


    So in both these sceanrios the points for those questions would not be removed.

    That is right.

    You (as admin) can remove a question but responder's reputation points are mostly independent of the *current* questions asked and his answers to those questions.

    I think there is a primary misunderstanding here how reputation works. It is not up to admin (unless you delete the user), but it is up to the users.

    For the second case you mention, you should obviously delete those answers *manually*

    When you delete a a simple WordPress page, any child pages related to the parent page are NOT deleted automatically.

    You can get a 404 response for such a case too.

    Q&A obeys the same rules.


  • stephen_martin

    ok yeah I know what you mean in regards to the points. Ok so maybe to sort this out for now what might help me is to understand if there is a way to reset the reputation points for users? Our dev site has users set up which unfortunately cannot be deleted as a lot of pre-launch work was not only testing but authoring content for those users. So is there anyway to reset to 0 in the DB?

    Secondly I have deleted the entire questions (from trash) for the users I am talking about and any questions they may have answered. However when I go to the Answers tab in their profile you still see a list of questions (But now title is gone) and what remains is the voting the questions had (see screenshot) So it is not deleting these from that page for some reason even though they now don't exist.