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

XF 1.5 SQL query to mass approve & move all "Moderation Queue" content to single thread?

Discussion in 'XenForo Questions and Support' started by RoldanLT, Mar 8, 2016.

  1. RoldanLT

    RoldanLT Well-Known Member

    We have 10,000+ Moderation Queue.
    And we want to mass approve all of these but merge them all into single thread.

    Can someone advice for the correct query?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Here is a start:


    But in the UPDATE query for posts you can also set the thread_id, like so:

    UPDATE xf_post
    SET message_state = 'visible', thread_id = X
    WHERE message_state = 'moderated';
    Change X to the thread_id of the single thread you want to use.

    Any moderated threads which are approved will end up empty since you are moving their posts. You may want to just delete those threads by replacing the UPDATE query for threads with this instead:

    FROM xf_thread
    WHERE discussion_state = 'moderated';
    This should be safe to do.

    Backup first to be safe.
    RoldanLT likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    And you will want to rebuild thread info (with post positions) afterwards:

    Admin CP -> Tools -> Rebuild Caches
    RoldanLT likes this.
  4. RoldanLT

    RoldanLT Well-Known Member

    This is all I need to do right?

    Admin CP -> Tools -> Rebuild Caches
  5. RoldanLT

    RoldanLT Well-Known Member

    I don't need this 2 query anymore Jake?
  6. RoldanLT

    RoldanLT Well-Known Member

    I'm stuck on 2nd query with lock timeout error.
  7. RoldanLT

    RoldanLT Well-Known Member


Share This Page