Clear submissions of all webforms via Drush

Public

Get raw version
php
  1. $nodes = node_load_multiple(array(), array(
  2. 'type' => 'webform',
  3. 'status' => 1,
  4. ));
  5.  
  6. $text= [];
  7.  
  8. foreach ($nodes as $node) {
  9. $text[] = 'drush webform-clear ' . $node->nid . ' -y';
  10. }
  11.  
  12. print implode(' && ', $text);