XF 1.5 Quickest way to delete posts in moderation queue?

ibrian

Well-known member
I've just important an old forum, and found nearly a 1000 moderated posts from nearly 10 years ago.

Rather than delete them one by one I figure there must be a faster way.

For example, in phpmyadmin could I simply "empty" the database table "xf_moderation_queue" to clear this? Or would that cause problems?
 
You can execute this sql query to delete them from the moderation queue.

Code:
DELETE
FROM xf_moderation_queue
WHERE content_type = 'post';

Then excecute this other query to delete them from the forums.

Code:
DELETE FROM xf_post
WHERE message_state = 'moderated';

However, it is advisable to make a backup of the database before you execute those queries.
 
Please don't delete posts like that. They need to be deleted from the UI as there is a lot of other data to clean up.

I'm not at my normal machine right now, but you may be able to use some custom JS (or a template modification) to select the delete option by default when the moderation queue page is loaded. You'll need to submit multiple pages of it, but that should be faster than clicking delete on each item.
 
One way to quickly set the "delete" value on all of the radio buttons is to do the following:
  1. Open your browser's development console (Usually F12)
  2. Go to the "Console" tab
  3. Enter the following and hit enter:
Code:
$('input[type="radio"][value="delete"]').click();

That should "click" automatically each radio button that has a value of "delete". You then just need to click the "Update Moderation Queue" button and repeat. This saves you from having to modify any templates or write any custom JS.
 
One way to quickly set the "delete" value on all of the radio buttons is to do the following:
  1. Open your browser's development console (Usually F12)
  2. Go to the "Console" tab
  3. Enter the following and hit enter:
Code:
$('input[type="radio"][value="delete"]').click();

That should "click" automatically each radio button that has a value of "delete". You then just need to click the "Update Moderation Queue" button and repeat. This saves you from having to modify any templates or write any custom JS.
Great idea (y)
 
Back
Top Bottom