How to delete all unpublished commands on Drupal using sql

DELETE c, rcb, dcb
FROM
    comment AS c
JOIN field_revision_comment_body AS rcb ON (c.cid = rcb.entity_id)
JOIN field_data_comment_body AS dcb ON (rcb.entity_id = dcb.entity_id)
WHERE
    c. STATUS = 0

or

DELETE FROM field_data_comment_body USING field_data_comment_body JOIN comment ON comment.cid=field_data_comment_body.entity_id AND comment.status=0
DELETE FROM field_revision_comment_body USING field_revision_comment_body JOIN comment ON comment.cid=field_revision_comment_body.entity_id AND comment.status=0
DELETE FROM comment WHERE status=0

Thank you pkosenko

https://www.drupal.org/forum/general/general-discussion/2010-05-16/mass-delete-spam-comments#comment-10964889

Written by marquin

Web Developer & Designer. I am experienced in all design software and coding languages including HTML, CSS, PHP, OOP, JavaScript, JQuery, JavaScript, XML, WordPress, Magento and other tools for media development.

View all author posts →

Leave a Reply

Your email address will not be published.

View Some Of Our Services