Problem:
100.000 unpublished Spam Comments.
Solution
#drush php:eval '
$storage = \Drupal::entityTypeManager()->getStorage("comment");
do {
$ids = \Drupal::entityQuery("comment")
->accessCheck(FALSE)
->condition("status", \Drupal\comment\CommentInterface::NOT_PUBLISHED)
->range(0, 100)
->execute();
if ($ids && rand(1,9999) < 2) {
$storage->delete($storage->loadMultiple($ids));
print "Comments deleted: " . count($ids) . PHP_EOL;
}
} while ($ids);
'
Neuen Kommentar schreiben