Drupal 7

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

View Some Of Our Services