Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By bdparker on
I have a lot of nodes on my test site... about 40,000. I want to get rid of almost all of a certain kind of these in bulk. For example, I added 38,000 content type "article" nodes on June 14th I want to remove.
I understand there are many ways to do this, but what is the easiest? I've installed many plugins which supposedly do this, but I haven't been able to figure out how to use them to do what i need. I guess drush is an option, but I'm not sure where to run those command either.
What's the best way, step by step, to remove multiples nodes?
Thanks!
Comments
First backup your work ...
First backup your work ...
As you consider your options, create a backup website and test out options there before deleting anything from your production website.
spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...
~
You can use Views bulk operations to build out a view of what you want to bulk delete.
A few years back I built a module that modifies the admin/content view with a bunch of extras (similar to the admin views module). One of the exposed filters is "Date posted" (you can also choose a date range). You can then filter for the ones created on June 14 and the bulk delete them.
https://www.drupal.org/project/admin_frosting
I just tested and the module works fine still. So you can use vbo or give Admin Frosting a go.
I'd create a custom drush
I'd create a custom drush command, that takes a date as an input and then deletes all nodes from that date.
First, in your custom module, add a [MODULENAME].drush.inc file.
Then, implement hook_drush_command()
The callback for this function will be in the format
drush_[modulename]_[command]
where the hyphens in the command are changed to underscores:Then you can call this using
dnfd 2017-06-14
.Make sure you back up your database first in case something goes wrong!
Hi,
Hi,
Use Bulk delete module....
It is an abandoned module. See for alternatives: