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

sql query for approving moderated posted?

Discussion in 'XenForo Questions and Support' started by Kaiser, May 26, 2011.

  1. Kaiser

    Kaiser Well-Known Member

    Well I just did a import of another forum db into my forum, and I have 300+ something moderated posts so is there a sql query I can run to approve all the posts?

    Edit: Looks like I messed up on the title :p
     
  2. Mikey

    Mikey Well-Known Member

    Code:
    UPDATE `xf_post` SET `message_state` = 'visible'  WHERE `message_state` = 'moderated'
    This will set EVERY moderated post to visible/unmoderated.
     
    Jake Bunce likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Don't forget the xf_moderation_queue records. You would need to run these two queries to approve all moderated posts (borrowing Mikey's query):

    Code:
    DELETE
    FROM xf_moderation_queue
    WHERE content_type = 'post';
    
    UPDATE xf_post
    SET message_state = 'visible'
    WHERE message_state = 'moderated';
    
    And here are the queries to approve all moderated threads (per this post):

    Code:
    DELETE
    FROM xf_moderation_queue
    WHERE content_type = 'thread';
    
    UPDATE xf_thread
    SET discussion_state = 'visible'
    WHERE discussion_state = 'moderated';
    
    You also need to run this query to reset the count in the moderator bar (per this post):

    Code:
    DELETE
    FROM xf_data_registry
    WHERE data_key = 'moderationCounts';
    
     
    Mikey, Tilki├čey and Kaiser like this.

Share This Page