Tos Web Developer provides insights, tutorials, and advice around topics including content strategy, design, Drupal Development, Drupal Custom Module Development, Drupal 8 Custom themes, PHP, Server, Twig, and more

Using Following a simple step and delete all nodes of the same content type.


Step 1
: install https://www.drupal.org/project/devel_php module with the required module.

Step 2: go to this link http:example.com/devel/php and below code.

Step 3: add this blow code into PHP code to execute the submit execute button.



 $result = \Drupal::entityQuery('node')  
    ->condition('type', 'article')  
    ->execute();  
 entity_delete_multiple('node', $result);  
 \Drupal::messenger()->addStatus(t('This is a successful deletete all content.'));  

Step 4 Goto to the content page and check you all nodes are deleted which mention content type name in code.

Hope this simple trick will help you to efficient your work.

Thank you for check out our blog keep support and shear with your drupal friend and colleagues.




No comments:

Post a Comment

| Designed And Blog Post by www.toswebdeveloper.com