• 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?

Kaiser

Well-known member
#1
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
 

Mikey

Well-known member
#2
Code:
UPDATE `xf_post` SET `message_state` = 'visible'  WHERE `message_state` = 'moderated'
This will set EVERY moderated post to visible/unmoderated.
 

Jake Bunce

XenForo moderator
Staff member
#3
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';