1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hard Delete?

Discussion in 'XenForo Questions and Support' started by Drae, Sep 4, 2012.

  1. Drae

    Drae Active Member

    I have the admin set-up so they can delete and hard-delete. As the admin I have deleted a few old posts and now want to hard-delete them. How do I do this?
     
  2. MagnusB

    MagnusB Well-Known Member

    There is no way to easily find the threads that are soft deleted except going to the admin CP and check the mod log.
     
    Drae likes this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    You can use this SQL query to hard delete all 'soft' deleted posts:
    Code:
    DELETE FROM `xf_post` WHERE `message_state` = 'deleted'
    Obviously you may not want to do them all so you might want to add other criteria into the query.

    Or you may just want to view your deleted posts which would be:

    Code:
    SELECT * FROM `xf_post` WHERE `message_state` = 'deleted'
    EDIT: By the way, I'm not certain if there's other things you'd need to do to "clean up" after hard deleting posts...
     
    Drae likes this.
  4. Drae

    Drae Active Member

    So the best/easiest thing would be to allow hard delete and not soft-delete?
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    On my forums we tend to have a rule that everything gets soft deleted and it stays that way.
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Using queries to hard delete posts can work, but it's not the cleanest thing to do. You will end up with orphaned records in other tables such as attachments. There is no easy way to do this cleanly with just queries. Ideally hard deletes should be done using the inline moderation tools.
     
    trilogy33 and Chris D like this.
  7. DBA

    DBA Well-Known Member

    Same here, hard delete is just to final. Plus giving your admins/moderators hard delete access can end in a disaster if one of them were to get pissed and hard delete everything.
     
    Chris D and CyclingTribe like this.
  8. CyclingTribe

    CyclingTribe Well-Known Member

    I was just about to post this - good call. (y)

    It's also the reason I never give anyone hard delete privs, not even my most dedicated, trusted and hard working mods. :coffee:
     
  9. trilogy33

    trilogy33 Well-Known Member

    XenUtiles has a function to prune the soft-dels after x number of days.
    Help much? :)
     
  10. DBA

    DBA Well-Known Member

    Heck I don't think I even gave myself hard delete permissions on my site. lol
     
    CyclingTribe and trilogy33 like this.
  11. trilogy33

    trilogy33 Well-Known Member

  12. MagnusB

    MagnusB Well-Known Member

    I have 2 super mods with hard delete capabilities, though they never use it, so in the end I end up hard deleting.
     

Share This Page