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

XF 1.5 Remove all duplicate posts

Discussion in 'XenForo Questions and Support' started by AliS, Jul 25, 2016.

  1. AliS

    AliS New Member

    Hello all,

    I have an old issue in my forum, which is that some of old posts are doubled. (content, user and date are all the same in both posts)
    I will not go thru the unnecessary detials of how this happened.
    But I need to know if there is a way to hide them or delete them either by a script or mysql statements.

    It would be really great if there is a solution!

    Thank you,
     
  2. Mike

    Mike XenForo Developer Staff Member

    The "how" may be relevant, but these posts would need to be removed manually via the UI.
     
    AliS likes this.
  3. AliS

    AliS New Member

    Interesting..

    The threads affected have the same pattern. The first post in the thread (the thread itself) must be exactly the same as the second one. Otherwise it is not affected.

    Depending on this info, can we build a mysql statement that get the affected threads? If yes, then I think then I can find a way to delete all even numbered posts.

    About the "how", honestly I do not know. Wrong restoration of a backup by old technical support guy :).
     
  4. Mike

    Mike XenForo Developer Staff Member

    You may be able to write a query that joins the xf_post table to itself based on the thread_id and the position (position + 1) to detect whether the content of the messages is identical. This would probably involve some testing and tweaking to get right though.
     
    AliS likes this.

Share This Page