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

XF 1.5 Quickest way to delete posts in moderation queue?

Discussion in 'XenForo Questions and Support' started by ibrian, May 29, 2016.

  1. ibrian

    ibrian Active 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?
  2. wang

    wang Well-Known Member

    You can execute this sql query to delete them from the moderation queue.

    FROM xf_moderation_queue
    WHERE content_type = 'post';
    Then excecute this other query to delete them from the forums.

    DELETE FROM xf_post
    WHERE message_state = 'moderated';
    However, it is advisable to make a backup of the database before you execute those queries.
    ibrian likes this.
  3. Mike

    Mike XenForo Developer Staff Member

    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.
    ibrian likes this.
  4. Chris D

    Chris D XenForo Developer Staff Member

    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:
    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.
    AndyB, TJ Adams, Mike and 3 others like this.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page