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


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?

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.